Vim Cheatsheet

Modal editing essentials. Assumes stock vim; neovim is compatible.

1 credit

Modes

4 items
Enter insert
i / a (after cursor) / o (new line below)
Back to normal
<Esc> or Ctrl-[
Visual
v (char) V (line) Ctrl-v (block)
Command-line
: / / / ?

Navigation

6 items
Left/Down/Up/Right
h j k l
Word forward/back
w b
Line start/end
0 $
File start/end
gg G
Go to line N
:N or NG
Search
/pattern n (next) N (prev)

Edit

8 items
Delete line
dd
Delete word
dw
Delete to end
d$ or D
Yank (copy)
yy / yw / y$
Paste after / before
p / P
Undo / redo
u / Ctrl-r
Replace char
r<char>
Change word
cw

Files / windows

4 items
Save
:w
Quit
:q / :q! / :wq / ZZ
Split horizontal / vertical
:sp :vsp
Switch window
Ctrl-w then h/j/k/l

Further reading