Why Vim Still Matters
Vim is over thirty years old and still the fastest way to edit text once its language clicks. The reason is modal editing: instead of reaching for the mouse or holding modifier keys, you compose small verbs and nouns — d for delete, w for word, so dw deletes a word. This grammar scales: once you know a dozen motions and a handful of operators, you can express hundreds of edits without thinking. Developers who invest two weeks of deliberate practice typically report never going back.
The cheat sheet above is organised the way Vim itself is organised: by mode. Normal mode is where you navigate and operate. Insert mode is for typing. Visual mode is for selecting. Command-line mode (the colon commands) is for files, searching and ex-commands. Learn which mode you are in at all times — the number one beginner error is typing commands into insert mode or text into normal mode.
The Survival Kit: Twelve Commands
If you learn nothing else, these twelve make you functional: i enters insert mode, Esc returns to normal, :w saves, :q quits, :wq saves and quits, :q! quits without saving, h/j/k/l move, dd deletes a line, u undoes, yy yanks (copies) a line, p pastes, and / searches. With just these you can open any file, edit it, and leave — which is the entire job most of the time.
Escaping the quit meme
The famous joke about not being able to quit Vim exists because modal confusion is real: newcomers type :q while in insert mode and see it inserted as text. The rule is simple — Esc first, then command. And :q! is the emergency exit: it discards everything since the last save. Prefer :wq when you mean to keep your work.
Motions: The True Power
Beginners move with h/j/k/l and arrow keys; intermediates move with words and lines. w jumps to the next word start, b back a word, e to word end, 0 to line start, $ to line end, gg to file top, G to file bottom. The leap is combining motions with operators: d$ deletes to end of line, yG yanks to end of file, caw changes a word. Motions are also countable — 3w jumps three words, 5dd deletes five lines — which is where Vim's speed comes from: one thought, one keystroke sequence, large precise change.
Text objects: Vim's secret weapon
Text objects select semantic units regardless of cursor position inside them. di( deletes inside parentheses, da' deletes around single quotes including the quotes, ci{ changes inside braces. The i/a distinction (inner vs around) plus a delimiter gives you surgical edits that mouse users cannot match. Learn iw, i(, i[, i{, it (HTML tag) and i' early — they pay off daily.
Visual Mode and Registers
Visual mode (v) selects text the way you are used to, then an operator acts on the selection — d deletes it, y yanks it, > indents it. V selects whole lines, Ctrl+v selects rectangular blocks, which is magical for editing columns of text. Yanked text goes into registers; the unnamed register is the default clipboard, but named registers let you juggle multiple clipboards, something most editors cannot do at all.
Search, Replace and Repeat
/pattern searches forward, n/N move through matches, * searches for the word under the cursor. :s/old/new/ substitutes on the current line, :%s/old/new/g across the whole file, with /c asking for confirmation each time. And the dot command (.) repeats your last change — the single most underused key in Vim. A typical power workflow is: search, make one perfect edit, then n.n.n. to repeat it down the file.
Marks for navigation
mx drops a named mark at the cursor; 'x jumps back to it. Marks turn long files into navigable spaces: mark the function you are editing, jump to a definition, then pop back with a single keystroke. Combined with Ctrl+o (jump back through the jump list), you rarely need to scroll aimlessly again.
Insert Mode Essentials
Most time in insert mode is plain typing, but a few keys save constant mode-switching: Ctrl+w deletes the previous word, Ctrl+u deletes to line start, Ctrl+r followed by a register pastes without leaving insert mode. And o/O open new lines below/above while staying in insert mode — faster than the Esc-then-o dance beginners do.
Command-Line Mode Power
Beyond :w and :q, the colon commands run the file-level operations: :e opens a file, :sp/:vsp split the window, :tabnew opens a tab, :!cmd runs a shell command, :r !cmd inserts command output. Ranges make them surgical: :10,20d deletes lines 10–20, :%!sort pipes the file through sort. Vim's command line is a small Unix philosophy embedded in the editor.
How This Cheat Sheet Helps
VimCheat keeps every command one search away: type delete, yank, or split and the grid filters instantly. Switch mode tabs to study one mode at a time, and click any command to copy its keystrokes. Keep it open in a side tab during your first month — that is how muscle memory gets built.
Making Vim Yours: vimrc Essentials
Vim's defaults are famously spartan; a small vimrc transforms the experience. Start with syntax on, set number, set relativenumber (line numbers relative to the cursor make motions like 5j precise), set tabstop=2 shiftwidth=2 expandtab for consistent indentation, set ignorecase smartcase for smarter searching, and a quick insert-mode escape mapping. Keep the file in version control — your vimrc is a developer fingerprint worth syncing across machines. Every setting is a :set command you can also try live before committing it to the file.
Vim vs Neovim
Neovim is a modern fork that keeps nearly all Vim keybindings while adding Lua configuration, built-in LSP support, Treesitter highlighting and an async plugin architecture. If you want IDE features — go-to-definition, inline diagnostics, fuzzy finding — Neovim gets you there with far less friction than classic Vimscript. The commands in this cheat sheet work identically in both, so your muscle memory transfers completely. Choose classic Vim for ubiquity (it is on every server you will ever ssh into) and Neovim for a daily driver you customise deeply. Learning the keybindings first, as this sheet teaches, is the right order either way.
The Dot Command and Macros
The dot command (.) repeats your last change — combine it with search for devastating efficiency: make one perfect edit, then n.n.n. down the file. When edits get complex, record a macro: qa starts recording into register a, q stops, @a replays. Macros shine on repetitive structured text — reformatting fifty lines, each needing the same five keystrokes. And for the truly repetitive, running the macro across a range applies it everywhere. The pattern is always the same: do it once perfectly, then let Vim repeat it.
Registers worth knowing
Beyond the named registers a-z, Vim has special ones: register 0 holds the last yank (unaffected by deletes, unlike the unnamed register), the plus and star registers talk to the system clipboard, / holds the last search pattern, and : shows the last command. Knowing how to paste the last yank even after deleting rescues countless workflows. Peek at :registers anytime to see what is stored where. Combine marks, macros and the dot command and you have the complete Vim power toolkit: navigate instantly, repeat effortlessly, automate the rest.
A Thirty-Day Learning Path
Week one: survive — open, edit, save, quit, undo. Week two: move — words, lines, file jumps, search. Week three: operate — delete, yank, paste, text objects, the dot command. Week four: compose — macros, marks, splits, command-line ranges. Practise fifteen minutes daily on real files rather than tutorials, keep this cheat sheet open beside you, and consider disabling the arrow keys after week two to force the new habits. Most learners cross the fluency threshold around day twenty and never look back.