Vim cheat sheet
Enough Vim to be fast, not just to escape: the motions and edits worth learning, search and replace, splits, and recording a macro.
In Snippet Keeper, click Import at the bottom of the sidebar and choose the file. They land in your vim app, and ones you already have are skipped. The highlighted parts become fill-in fields: type a value (or pick one), and the finished command is on your clipboard.
Moving
w / b
0 / $
^
gg / G
lineG
%
Ctrl-d / Ctrl-u
*
Editing
i / a
A
o / O
ciw
ci"
dd
D
yy
p
u / Ctrl-r
.
>> / <<
J
Search and replace
/pattern
n / N
:%s/find/replace/g
:%s/find/replace/gc
:noh
Visual mode
v / V / Ctrl-v
gv
Files and splits
:w
:wq
:q!
:e file
:split file
Ctrl-w w
:w !sudo tee % > /dev/null
Macros
qregister
@register
count@register
Keep these one keystroke away.
Snippet Keeper is a Mac app for the commands you keep looking up. Press ⌥⇧Space in any app, type a few letters, fill in the blanks, and it’s on your clipboard.