Show HN: I built a little browser game to practice Vim commands
I made hjkl to help myself remember Vim commands. It’s a little browser game you can play when you want to unwind and get a bit of Vim practice in.
There are still a lot of commands I want to add, but I hope someone finds it useful in the meantime :)
(
38 comments
| on HN
)
One note: It might be useful to keep the "undo" prompt when the user messes up after the first two prompted lessons for a clear recovery path.
Thank you for making this!
Where dw works, this game teaches vlllld instead, which is a bad habit to teach.
Ctrl+A increments the first number after the cursor, which is easier than, say, f6r7 in cases where they do the same thing. Similarly, Ctrl+X decrements.
t:t: is weird when fY is much easier.
The Vim simulator has a minor difference compared to real Vim:
Start on line one and do CTRL-V then j then CTRL-A. Real Vim would increment both. The simulator only increments the one under the cursor.also there is an opportunity to turn this into something like vim.golf but in the browser
It does not make sense to me that I should use an editor I need to study and practice for. It can't possibly that much more efficient, especially given that usually speed is not the limiting factor for what I do.
Maybe one day I will be tempted to find out why it's supposedly worth it again.
Without vim, your language is limited to very basic actions that you need to repeat ad nauseam.
https://helix-editor.com/
It is. And I’m not even an advanced Vim user.
> especially given that usually speed is not the limiting factor for what I do.
For me it’s not so much about speed as about comfort. Jumping into VISUAL and selecting something in a block, yanking the line, jumping pages, editors, searching within the file, filtering, sorting. And the most important part is that because it is so old and widespread there’s pretty much vim mode for any editor so I can use the same shortcuts between vim, VScode, IntelliJ, etc.
do the thing you enjoy :)
The funniest time I did this was with a interview screening question which had a hundred-deep chain of links with the URL for the next link embedded in some JSON with some additional formatting required to get a working link. Vim let me copy a line of text that's a curl command, shell out to replace it with the ~6 lines of JSON response, edit that as a string down to a curl command to the next URL, and wrap that entire process up as a macro to run a hundred times.
I learned Vim because I didn't like using Nano to edit server configs, and ended up sticking with it because I wanted to ditch my mouse in my workflow for fear of long-term RSI development.
Vimtutor is a built-in command in Vim and Neovim, and I personally wish I started with it since it's super helpful. You only have to learn as much as you need to, to become productive and then you can progressively get more advanced with macros and piping the file contents to a command line tool like jq.
[1]: https://web.archive.org/web/20180318023156/https://www.viemu...
I stopped after learning enough to get by but can see how having all of it learned and automatic would be pretty efficient.