Vim games: the best ways to learn Vim by playing
The best-known Vim game is Vim Adventures, a paid browser adventure that teaches motions level by level. For practice once you know the basics, VimGolf (real Vim, fewest keystrokes wins), Vim Racer and VIM GYM (speed races) are free. Games are great for making keys stick, but most of them drill rather than teach, so pair them with vimtutor or a course.
| Game | What it trains | Price | Install? |
|---|---|---|---|
| Vim Adventures | Motions and commands, taught through a story in 13 levels | Opening levels free; $35, or $40 with challenges, for 6 months | No, browser (physical keyboard) |
| VimGolf (vimgolf.com) | Editing in the fewest keystrokes, in real Vim | Free | Yes: gem install vimgolf, or Docker |
| Daily Vim golf (VimNinja) | Editing in the fewest keystrokes, one new hole a day | Free; sign in to post a score | No, browser |
| Vim Racer | Navigation speed: reach 12 targets as fast as you can | Free (donations) | No, browser |
| VIM GYM | Motions, editing and deletion speed, racing others or solo | Free | No, browser (desktop) |
| vim-hero challenges | Generated challenges inside its lessons | First 12 lessons free; full access $20 | No, browser |
| VimGenius | Recall: timed flashcards for commands | Free, no sign-up | No, browser |
Games that teach: Vim Adventures
Vim Adventures is the one most people mean by "the Vim game". It calls itself "Zelda meets text editing": you play a cursor in a world made of text, you start able to move only with h j k l, and you collect keys that unlock new commands as you go. You can't leave a level until you have mastered its skill.
Its site says the full game teaches more than 60 commands and motions across 13 levels, from word motions and f / t to operators, registers, marks and buffers. The Game & Challenges licence adds timed challenges with reviews of how you did, and a level on macros.
Price: the opening levels are free to play. A Game-Only licence is $35 and Game & Challenges is $40, each for 6 months of access, not for good. Group licences are available on request. It needs a physical keyboard.
Good for: making the first week of Vim fun. Less good for: depth; it is a game first, and what you learn there still needs practice on real files.
Games for practice: golf
Vim golf gives you a start text, a target text and a score: the number of keystrokes you used. Fewest wins. It is the best way to discover the commands you didn't know you needed, because the leaderboard shows you someone else's shorter way.
- VimGolf (vimgolf.com) is the original, with years of community challenges. It runs in real Vim on your machine: install the client with
gem install vimgolf(or use its Docker image), sign in on the site to get your key, runvimgolf setup, thenvimgolf putwith a challenge ID. Your keystrokes are logged in a local Vim session and scored when you save and quit. Free. - Daily Vim golf on VimNinja (the holes) runs in the browser on VimNinja's own Vim engine, so there is nothing to install. There is a new hole every day, each with a par (the length of a known good solution). Every key counts, Esc and ↵ included. When you finish, the par solution and the day's leaderboard open up, and you get a shareable row of squares, one per keystroke. Free to play; sign in to put your score on the board.
Golf rewards things like *, cgn and . that tutorials rarely stress, so it is a good second step once w, c and d are comfortable. It is a bad first step: if you don't know the basics yet, you will just stare at the target.
A real hole: Rider, now courier (par 14)
This is the courier hole from VimNinja's golf, playable right here. Legal says riders are couriers now: rename the variable rider everywhere, but leave riders alone. Par 14 keystrokes. Any keys that get there count; when you are done, see how par does it in the hint, then try the daily hole.
Stuck? Show the keys
Par: * searches for the whole wordrider (so riders doesn't match), cgn changes the next match, you type courier and Esc, then . . does the other two.This editor needs a keyboard. Read on, and play it at your computer.
Games for speed: races
- Vim Racer (vim-racer.com) is a navigation speed test: a target appears in a file, you get the cursor there with any Vim motion, the next target appears, and the clock stops after 12. The leaderboard shows the keys each player used, which is a quick way to learn motions like } or % from people faster than you. It is free, asks for donations, and has no accounts: you just pick a username.
- VIM GYM (vimgym.app) lets you race other players online, run a private match with a room code, take the shared race of the day, or practise solo. Its site says it trains navigation, editing and deletion, that it is best played on a desktop computer, and that it "is free and will always stay free".
Races reward speed with what you know rather than teaching new commands, so they work best a few weeks in.
Speed round: one motion each
Races reward knowing the motion that gets there in one go. Type the keys for each from memory.
Drills that feel like games
- vim-hero generates challenges inside its lessons so you can repeat a skill until it sticks, and tracks your proficiency in each one. The first 12 lessons are free without an account; full access is $20.
- VimGenius is a timed flashcard game: you get a goal and type the command. It is free and needs no sign-up.
- VimNinja's practice drills (practice) give you short repeatable exercises in the browser, alongside the daily golf.
Which Vim game should you play?
- Never used Vim: run
vimtutorfirst (it is free and takes 30 minutes), then Vim Adventures if you want the next week to feel like play. - Know the basics, want to get efficient: golf. VimGolf if you want real Vim and a deep archive; the daily hole on VimNinja if you want something in the browser in two minutes a day.
- Want to be faster at moving around: Vim Racer or VIM GYM.
- Want something structured that also checks your work: a course rather than a game. See the best way to learn Vim for those.
Whatever you play, the keys only stay if you use them on real text. Five minutes of a game a day plus real editing beats an hour of games on a Sunday.
Questions
- Is Vim Adventures free?
- The opening levels are free. The full game is $35 for 6 months of access, or $40 including timed challenges and a macros level.
- Do I need Vim installed to play VimGolf?
- Yes. VimGolf runs challenges in real Vim through a client you install with
gem install vimgolf, or through its Docker image. Browser golf like the daily hole on VimNinja needs no install. - Can a game teach me Vim on its own?
- It can teach you motions and make them fun, but games mostly drill. Pair one with
vimtutor, daily use on real files, and a course or a book for the dot command and text objects.