Learn Practice Daily golf Reference
Interactive Vim tutorial

Learn Vim, one habit at a time

Short lessons that you play in a real Vim editor. Each one follows the same rhythm: learn the idea, try it, try it with a twist, then a boss round scored against par.

Between lessons: practice drills, the Vim cheat sheet, and a daily hole of Vim golf.

Still deciding? Is Vim worth learning, the best way to learn it, and Vim or Neovim.

Start here
Meet the modes

In Normal mode your keyboard is a remote full of commands; in Insert mode it types. i switches to typing, Esc back to the remote, x is your first button, and u takes back a mistake.

Begin →iEscx
Foundations · chapter 1 of 82 · 7 min
Daily 5
spaced repetition

Finish a lesson and its commands start appearing here, scheduled for review just before you'd forget them. Chapter 1 adds these:

Foundations

Free

Modes, movement and the six ways to start typing. Everything else builds on these.

The Vim Way

Free

Think in repeatable changes: the dot command and its formula, combos, search-and-stamp renames, a way back from every repeat, undo, and number counters.

Operators

Pro

Verb plus noun: delete, change, yank and friends, combined with every motion you know.

Vertical movement

Pro

Relative and absolute jumps, paragraphs, scrolling and the screen: finding your way around a 300-line file.

Text objects

Pro

Words, quotes, brackets, tags and paragraphs as nouns: you don't select text, you name it.

Visual mode

Pro

Characters, lines and blocks: select when you need to see it, and know when an operator is better.

Insert mode power

Pro

Fix typos, run one Normal command, paste, complete and calculate without leaving Insert mode, and type over text with Replace mode.

Registers

Pro

Vim has a whole shelf of jars: the everyday and yank jars, jars you label yourself, the bin, the clipboard and a history of deletes.

Macros

Pro

Record a change once, replay it five hundred times, and write macros that work on every line.

Ex & substitution

Pro

Ranges, :s and its flags, :g, :normal, copy, move and sort: edit a whole file in one line.

12.18 min
Ranges

Monday's :2,$normal @a was an order slip: which lines (., $, %, .,+3, ribbons, a highlight), what to do, and ↵ sends it: :.,+2d↵, :%s/rider/courier/g↵.

:d:s:%
12.211 min
:s flags and specials

The slip's small print: g every match on the line, c ask at each one (y or n), i any case; in the replacement & is the match, \1 a circled group, \u a capital, \= works it out. Then five files, five decisions.

:s///gc&\1\=
12.37 min
Repeat substitutions

The kitchen keeps the last slip: :&&↵ sends it again on this line with its flags, g& to every line (with your last search as the pattern, so :%&&↵ after a search); and * then :%s//new/g renames the word you pointed at.

:&&g&:%&&
12.48 min
:g and :v

A slip that picks its lines by what they say: :g/pattern/ every line that matches, :v/pattern/ every line that doesn't, then any order: :g/console\.log/d↵, :v/courier/d↵, m$ (move below the last line).

:g:v
12.57 min
:normal on ranges

:normal takes any Normal-mode keys for every line on the slip: :%normal␣A;↵, :g/./normal␣A;↵ to skip the gaps, a highlight with I// , or only the lines :g picks. Then you choose the tool.

:normal:g//normal
12.67 min
Copy, move, sort

Orders that rearrange the lines: :t copies them to below a line you name (and leaves the jars alone), :m moves them, and :sort lines them up (u drops duplicates, n by number, a range keeps the heading out).

:t:m:sort
12.711 min
Migration night

The whole of track twelve before midnight: the rename with the handbook link kept, the ids moved up by 1000 with \=submatch(0)+1000, and the docs cleaned with :g and a ranged :sort u. Then the release.

:%s\=:sort␣u

Real-world refactors

Pro

Six long boss levels on real code in TypeScript, JavaScript, Python, JSON, CSV and Markdown, scored against par.

Plugins & your editor

Pro

Surround and commentary, VS Code Vim and IdeaVim, and your first Neovim config.

Coming next