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

KeysAction
iInsert before cursor
EscBack to normal mode
:wSave
:qQuit
:wq or ZZSave and quit
:q!Quit without saving

Moving

KeysAction
h j k lLeft, down, up, right
w / bNext / previous word
0 / $Start / end of line
gg / GTop / bottom of file
{ / }Previous / next paragraph
Ctrl-d / Ctrl-uHalf page down / up

Editing

KeysAction
xDelete character
ddDelete line
yyYank (copy) line
pPaste after cursor
uUndo
Ctrl-rRedo
cwChange 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.

Related notes