Vim Cheat Sheet
The essential Vim motions and commands to get productive and get out.
~1 min read updated Jul 17, 2026 Cheat Sheets
#vim #editor #cheat-sheet #cli
Enough Vim to edit confidently — and, crucially, to quit. Everything below is
from normal mode (press Esc to get there).
Surviving
| Keys | Action |
|---|---|
i | Insert before cursor |
Esc | Back to normal mode |
:w | Save |
:q | Quit |
:wq or ZZ | Save and quit |
:q! | Quit without saving |
Moving
| Keys | Action |
|---|---|
h j k l | Left, down, up, right |
w / b | Next / previous word |
0 / $ | Start / end of line |
gg / G | Top / bottom of file |
{ / } | Previous / next paragraph |
Ctrl-d / Ctrl-u | Half page down / up |
Editing
| Keys | Action |
|---|---|
x | Delete character |
dd | Delete line |
yy | Yank (copy) line |
p | Paste after cursor |
u | Undo |
Ctrl-r | Redo |
cw | Change word |
. | Repeat last change |
Search & replace
/pattern search forward (n = next, N = previous)
:%s/old/new/g replace all in file
:%s/old/new/gc replace all, confirming each
The real power is combining operators with motions:
d (delete) + w (word) =
dw. Learn the grammar, not a list of commands.Cheat Sheets
Dense, scannable references for commands and syntax.
Templates
Reusable starting points for files, configs and docs.