25 comments

  • glibg10b 9 hours ago
    For all of the ciw examples, ce is easier since the cursor is at the first letter of the word.

    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:

        0
        0
    
    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.
  • wjgilmore 25 minutes ago
    Just wanted to say I really love your project! Using Vim and TMUX more than ever these days alongside the Claude Code terminal integration, so this is a great tool to become even more proficient with Vim movements.
  • gosen 3 hours ago
    cool! but I have a problem, how can I exit this game?
  • usrme 10 hours ago
    I did the first challenge or exercise, but I was honestly a little surprised that Vim motions aren't able to be used to choose the next exercise(s) in the sidebar that becomes visible. That could potentially be something that the player unlocks later on as well.
    • dh1011 9 hours ago
      Good idea! I will work on this.
  • autuni 7 hours ago
    I have considered getting into Vim a couple of times because it always seemed like the thing to do, but never did.

    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.

    • funcDropShadow 2 hours ago
      The web page "Why, oh WHY, do those #?@! nutheads use vi?" [1] convinced me almost 20 years ago to give it a try. Already then, it looked like an outdated mode of editing text, but I was wrong.

      [1]: https://web.archive.org/web/20180318023156/https://www.viemu...

    • epiccoleman 56 minutes ago
      The trick is to just use the thing. You really don't need to study anything.

      There's a bit of a hump you have to jump through when you're first getting used to having separate modes for input and editing / navigation, but that's honestly the worst part.

      After that, you just need to notice things that you need to do often, and then go "I bet vim makes that easy." You pick up a little trick and use it. You probably don't remember it the next time, but you remember there was a way, and you look it up again and reinforce it. You eventually remember the things that were useful to you, and forget the "tricky stuff" that wasn't.

      Over time, you start getting your head around how it works, the whole verb / subject thing, and then you start learning to speak the language. You stop thinking "ok, i need to go to normal mode, then type c, then in, then t" and start thinking "change inside tag".

      Vim's not really about "editing super fast." It's more like a different mental model of editing text that really, genuinely, is better than the default mode on offer in your standard text editor. It's more keyboard driven and composable and just _capable_. Text editing operations that are annoying in standard editors are trivial in vim.

      I think these little games are neat, but ultimately wrongheaded. The best way to learn vim is to use vim to do vim things. I've been using vim (or, more often, vim editing modes in VSCode or IDE du jour) for around a decade, and I bet I don't use 95% of what it can do. But that 5% I do know is extremely useful.

      Also though: it's a nerdy text editor, and it's fine if you don't like it or want to learn to use it.

    • williamdclt 1 hour ago
      I've been using vim keybindings in all my IDEs for the past 10y, and IMO you're mostly right, it's not worth it. It's definitely pretty fast, I'm probably faster at writing code than 95% of my coworkers despite being a poor typist, but TBH I don't think I'm much faster than when I used to learn/configure my editor's shortcuts.

      Other commenter mention stuff like yanking, moving lines, selecting blocks, word-level and line-level operations, scrolling pages, that's all stuff that editors can absolutely do (despite what vim-lovers say) and sometimes do it better as they're semantics-aware ("go to function arguments" is possibly in intellij but not really in vim, and vim block selection doesn't work in indented languages like YAML or Python). Recording macros? Intellij has it.

      Editors don't do stuff like "delete the next 5 lines" or "delete up to line 38", but I find that I never do that in Vim: if I have to count lines or look up the line number, might as well do a selection as I go and then just press "delete", or to delete a small chunk of lines and press "." (repeat) until I'm done. More keystrokes, but no cognitive effort so faster overall.

      Sure, there's stuff like executing some command you have selected and piping the result into your vim buffer, mixing that in with macros... Vim is probably the fastest way to do this sort of stuff, but I have use for that maybe once every three months? It'd take me more time to look up how to do it with vim than to do it manually.

      If you really get serious with it, you can probably be much faster with Vim than I am. If that's something you're interested in, go for it, but IMO that's closer to a hobby than anything else. Editing speed rarely is the bottleneck as you say. Still kinda nice to have consistent keybindings across editors, and I find vim pretty good for freetext notes.

    • TonyStr 6 hours ago
      Does it make sense that you should use a keyboard you need to study and practice for? Because I'm willing to bet you didn't instantly learn touch typing the first time you laid eyes on a keyboard. I would also bet that you didn't know about ctrl c, ctrl v, ctrl x, multiple cursors, tab, and so many other things that you now take for granted in code editors and elsewhere. Vim is just like that - a little foreign in the start, but after using it for a while it becomes second nature. You can learn just the basics and be productive in a couple of days, then you have the rest of your life to learn the more advanced features like terminal mode or macros and so on. Though it seems most people (me included) get really excited about learning vim once we get into it, and start sprinting through a bunch of features. That can make it seem a bit overwhelming.
    • chrysoprace 4 hours ago
      Well consider this, if you end up liking Vim you'll almost certainly want to have Vim keybindings in everything you use. :)

      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.

      Edit: Lastly, vi(m) keybinds exist in a surprising number of GNU/Linux utilities and it's worhwhile to learn those at least, e.g. git's built-in pager uses a subset of vi(m) keybinds and so does `less`.

    • opan 1 hour ago
      I find it fun and satisfying, a joy to edit in. The best way to learn is to just use it all the time. If something seems slow or hard to do, try to figure out a better way to do it. There is a lot of consistency and logic, so once you get a basic grasp you can intuitively figure out new motions. Like once you know the verbs to delete or change you can pair them with various movements. dw to delete a word, but if you're gonna go into insert mode right after anyway you might as well do cw to change word. There are some interesting niche things vim can do that I don't know another easy way to do as well. Need exactly 80 dash characters? 80i- will do it. Can similarly use o instead of i (the new line + insert bind) to make n lines of something that are identical. It's like very accurate efficient copy-pasting. Another fun one is if you've accidentally typed a sentence with caps lock on "a BIT LIKE THIS.", you can select it in visual mode and hit ~ to swap the caps for the whole selection. I think most people would just retype it, or maybe force lower all of it somehow then retype the first letter.

      Macros are really neat as well. Basically, think through the motions to do a particular edit, even if it's very convoluted, maybe 20 motions, then you can record it and play it back, repeat it any number of times (like to do the same edit to 100 lines in a row), or save it to a keybind in your config. Macros can also include commands and [vim] window management. Like I have two files I work in side by side a lot and I made a bind to delete the second line of both files and save both files. Under the hood it is very manually jumping to line 2, deleting, saving the file, swapping windows, doing the same, swapping back at the end. When played back it appears as though it did just what you wanted instantly, though. If I ever find I'm doing a bunch of repetitive manual steps like that a lot, I think about whether a macro saved to a keybind would be a good idea.

      I use vim for personal notes, editing configs, managing playlist (.m3u) files, etc. I'm not a programmer.

    • phkahler 1 hour ago
      I had the same thoughts and then one day I was force to use it when git landed me in vim. So then I did a bit of research on how to learn it, and that's when I discovered that I already had vimtutor. Just run that and use it daily for while to the basics. Then you can get a feel for how it's efficient.

      I stopped after learning enough to get by but can see how having all of it learned and automatic would be pretty efficient.

    • solyin 1 hour ago
      If you are choosing a path that involves editing text, why does it not make sense that you would need to study and practice to get good at the tools of your trade? Does a carpenter or airline pilot not need study and practice with their tools to get good at their trade?
    • wiseowise 7 hours ago
      > It can't possibly that much more efficient,

      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.

    • glibg10b 7 hours ago
      For me, it's about comfort. No need to bounce my right hand between the home row, the arrow keys and the mouse. No need to stretch my left pinky to Ctrl and Shift for every shortcut. Everything is near the home row in Vim, by design.
      • zzril 6 hours ago
        Comfort and reducing context switching overhead. Targeting a specific screen area with the mouse just takes way too much attention.
        • xeyownt 4 hours ago
          And I'd add language. With vim, you can hardwire your brain to your keyboard / editor, and use some sort of language to almost unconsciously express what you want to do. Like edit a typo, move a work, move a paragraph, capitalize this, etc.

          Without vim, your language is limited to very basic actions that you need to repeat ad nauseam.

    • ghtbircshotbe 1 hour ago
      You don't need to learn anything - you can create your own shortcuts. The thing I like about vi vs emacs is the separation between normal/insert/command modes.
    • ThrustVectoring 6 hours ago
      The real strength of vim (and emacs, though I haven't learned emacs to know this firsthand) is the expressivity of it rather than the raw speed. When you can express an edit as a sequence of key presses, you can record and replay that to easily and make the "same edit" in many places.

      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.

      • tsegers 6 hours ago
        I still vividly remember a peer watching me carefully record a vim macro, thinking I was just editing. Right as he said "Why are you so slow?!?", I ran `100@q` to apply the edit to the whole file. Just "oh." after that.
      • skydhash 3 hours ago
        As a vim and emacs user, macros are really nice. But the true superpower, IMO, is that code is fairly structural in the file and outside of it, and both allow me to quickly navigate that structure. Vim is more powerful on the edit side, but emacs has more convenient utilities.
    • ro-ka 7 hours ago
      I felt the same and never got into vim. What clicked for me however is helix and I love it. Brings everything out of the box and the mental model fits me better (select, then action).

      https://helix-editor.com/

    • bbeonx 7 hours ago
      (a) vim is super powerful (b) vim is way faster to edit, navigate, etc (c) it really doesn't matter that much

      do the thing you enjoy :)

  • solyin 1 hour ago
    This is fun! (god I'm a nerd) If I hit reload though, it takes me out of my current problem and back to the landing page, instead of resetting it.
  • nickandbro 1 hour ago
    This is very cool, definitely makes you more familiarly with the movement shortcuts! I created something similar at: https://vimgolf.ai
    • solyin 1 hour ago
      Needs an account? Bounced.

      Drop users into it and then spring the "there are more lesson to play" after they've reached some goal.

  • zzril 6 hours ago
    I was somewhat irritated that the exercises allow you to stay in insert mode at the end. I think it might do better at teaching the concept of an "edit" as a single, repeatable action by requiring you to go back to normal mode.
  • test_user369 4 hours ago
    I learned the basics a couple of years ago and although Claude does most of my work now, I'll try it to learn some new tricks. Thanks for posting!
  • jaydonb 10 hours ago
    This is great, definitely going to be using this to practice!

    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!

    • dh1011 9 hours ago
      Thanks for the suggestion! I will add that in.
  • parasti 8 hours ago
    This got a laugh out of me. I guess I practiced vim commands in the most boring way - by using vim.
  • assimpleaspossi 2 hours ago
    I actually like this and I don't like anything.
  • alabhyajindal 8 hours ago
    very cool! one feedback - when i selected all skills the game started with all the options of "fix a typo" first - i would like a version where all the challenges are jumbled up.

    also there is an opportunity to turn this into something like vim.golf but in the browser

  • atakmim 4 hours ago
    I tried and finally I will learn and understand Vim better playing a game :) Thanks!
  • internet_points 7 hours ago
    The best game to learn hjkl movement will always be nethack :)
  • francescobonomi 7 hours ago
    This unlocked the memory of when I first used vimtutor and discovered the beautiful world of vim, that was also a great resource
  • TheBuc 5 hours ago
    Cool, this could be a big help for those just starting out!
  • etuil 7 hours ago
    the marker "ma" exercises are a bit confusing since you do make a marker but in most cases you don't have to go back to make a change to that marker
  • anil_gr 10 hours ago
    Cool, a small ux issue I noticed is that the grid cells are not clickable as a whole.
    • dh1011 10 hours ago
      Agreed, it would be nicer if the whole cell were clickable. I’ll work on this. I also recommend to use hjkl to navigate and Space to select. I think that’s more fun :).
  • sponno 9 hours ago
    Very annoyed I cannot operate the website with the keyboard, have to do the practices then use my mouse.
  • syngrog66 8 hours ago
    vim use is whats reliably helped me to remember vim commands. a bonus is I can use the same tactic for all other software and in many other domains where I'd like to keep related skills fresh in mind, at figurative fingertips
  • senectus1 10 hours ago
    oh man this is great. thank you!
    • dh1011 10 hours ago
      Thanks for trying it out!
  • ReDress 2 hours ago
    [dead]
  • rivetworkshop 9 hours ago
    [flagged]
  • amarlearning 9 hours ago
    [flagged]