navasvarela/vimdojo

website github github
game
stars 2
issues 0
subscribers 0
forks 0
CREATED

UPDATED


vimdojo

Learn Vim motions by solving tiny puzzles, right inside Neovim.

vimdojo: open the menu, read the pack's lesson, solve a level in five keys, and move on to the next

Each level gives you a snippet of text and a goal ("delete the typo", "put the cursor on the last word"). Solve it with Vim keys. You're scored on keystrokes, time and the level's par. Every key counts, so finding the short way is the game.

Play in your browser: 45 levels and the daily run on the site with nothing to install. Then install the plugin for the rest.

  • 135 levels in twenty-two packs across three tracks. Motions covers basic motions through macros and Ex commands, then regex power, the expression register, boss levels that are whole refactors, marks and jumps, Ex ranges, and filters and formatting. Usage covers windows and buffers, project-wide edits with the quickfix list, and Neovim's built-in defaults. Setup teaches writing (and fixing) an init.lua: options, keymaps, autocommands and user commands, checked by running your config in a sandboxed Neovim.
  • Each pack opens with a short lesson: the idea, each command with an example, and the :help to read next
  • A daily puzzle from 42 levels you won't find anywhere else. It gets harder through the week, from easy on Monday to fiendish edge cases at the weekend, with streaks and an archive of past dailies
  • A live timer and key counter, with stars and points against par
  • Hints, instant reset, progress saved across sessions, and a practice mode that records nothing
  • Every level runs in a clean, isolated Neovim (or with your own config, if you prefer)
  • No dependencies, and near-zero startup cost (only the command is defined until you use it)

Install

Requires Neovim 0.10+.

lazy.nvim

{ "navasvarela/vimdojo", cmd = "VimDojo", opts = {} }

packer.nvim

use({ "navasvarela/vimdojo" })

vim-plug

Plug 'navasvarela/vimdojo'

rocks.nvim

:Rocks install vimdojo

Then run :VimDojo. Full documentation: :help vimdojo.

Playing

Key / command Action
:VimDojo Open the level menu (<CR> to play, q to close)
:VimDojo daily Play today's daily challenge, the same level for everyone and on the site
? on the menu or results card, or :VimDojo help How to play, scoring, keys and commands, in a panel
<leader>h Show the hint (caps the attempt at 2 stars)
<leader>r Restart the level
<Esc><Esc> Leave the level
p on the menu, or :VimDojo practice {level} Practice a level: nothing recorded, hints free
L on the menu Read a pack's lesson
n / r / y / m On the results card: next level, retry, copy a spoiler-free result to share, menu

The timer starts on your first key. Every physical key counts (d2w is 3 keys, <Esc> is 1), and the game's own control keys never do. A level is solved as soon as its goal holds in Normal mode.

Stars: 3 for matching par on both keys and time, 2 for up to 1.5× par keys, and 1 for solving it. Par is the shortest solution that uses only the motions taught so far, so if you know more Vim, you can beat it. A daily isn't part of the curriculum, so its par is the shortest route known, with any keys.

Configuration

require("vimdojo").setup({
  unlock_all = false,  -- skip progression locks
  window = "float",    -- "float" | "tab"
  config = "clean",    -- "clean": levels run in a stock Neovim; "mine": with your config
  progress_path = nil, -- defaults to stdpath("data")/vimdojo/progress.json
  challenges_dir = nil, -- play your own packs instead of the built-in ones
  keymaps = { hint = "<leader>h", reset = "<leader>r", quit = "<Esc><Esc>" },
})

Each level runs in its own clean Neovim inside a terminal window, so your registers, windows and settings are never touched, and your plugins can't interfere with par. Set config = "mine" to practice with your own setup.

Leaderboards

Optional, and off until you turn them on. The game works with no account and no network either way.

{ "navasvarela/vimdojo", cmd = "VimDojo", opts = { online = { enabled = true } } }
Command What it does
:VimDojo login Sign in with GitHub and pick a public handle
s on the results card Submit the run: a server replays it in a clean Neovim and recounts the keys
b on the results card, or :VimDojo board [level] The level's leaderboard, right in Neovim
:VimDojo scores Your verified bests and places, and what you haven't sent
:VimDojo submit Send the best run of every level you've played

Boards rank by verified keys, then by who got there first, and show handles and counts only, because your keys are that level's solution. Setup levels aren't ranked. They're also at vimdojo.org/boards, and here's what's stored. You can submit runs from the browser demo too, once you've signed in on the site: they're replayed in real Neovim, so both share one board.

Community

Share your daily result (y on the results card copies it without the solution) and talk levels, beaten pars and ideas in Discussions.

Contributing

New levels are the best contribution: they're plain JSON, and the tests prove each one is solvable within par in real Neovim. See docs/authoring-levels.md and CONTRIBUTING.md. Design decisions are logged in docs/decisions.md.

License

MIT