Vim Survival Guide

Enough Vim to edit confidently on any server — modes, motions, and the operator+motion grammar that makes it click.

Modes & saving

Normal ↔ Insert
i insert · a append · Esc back to normal
Save / quit
:w save · :q quit · :wq both · :q! discard
Open a line
o below · O above (enters insert)
Visual select
v char · V line · Ctrl-v block

Move (motions)

Word / back
w next word · b back · e end of word
Line ends
0 start · ^ first non-blank · $ end
File
gg top · G bottom · 42G line 42
Find char in line
f x to next x · ; repeat · t x till before x
Match bracket
% jump to matching ( ) { } [ ]

Edit (operator + motion)

Delete
dd line · dw word · d$ to end
Change (delete+insert)
cw word · ciw inner word · ci" inside quotes
Yank / paste
yy copy line · p paste after · P before
Undo / redo
u undo · Ctrl-r redo · . repeat last change
Grammar
operator + motion: d+2w = delete 2 words. Composable.

Search & replace

Search
/text then n/N · * word under cursor
Replace in file
:%s/old/new/g · confirm each: add c
Clear highlight
:noh