Cheatsheets
Vim
Vim motions, editing, search/replace, and file commands.
34 entries
Motions9
h j k lLeft, down, up, right
w / b / eNext / previous / end of word
0 / ^ / $Line start / first non-blank / end
gg / GTop / bottom of file
{ / }Previous / next paragraph
Ctrl-d / Ctrl-uHalf page down / up
:<n> or <n>GJump to line n
% Jump to matching bracket
f<char> / t<char>Jump to / before next char on line
Editing9
i / a / AInsert before / after cursor / end of line
o / OOpen line below / above
dd / yy / pDelete / yank line, paste
cw / ciwChange word / inner word
ci" / di(Change inside quotes / delete inside parens
x / r<char>Delete char / replace char
u / Ctrl-rUndo / redo
>> / <<Indent / dedent line
.Repeat the last change
Search & replace6
/pattern ?patternSearch forward / backward
n / NNext / previous match
* / #Search word under cursor fwd / back
:%s/old/new/gReplace all in the file
:%s/old/new/gcReplace all, confirming each
:g/pattern/dDelete all lines matching pattern
Visual & registers5
v / V / Ctrl-vVisual / line / block mode
gvReselect the last visual selection
"ayy / "apYank to / paste from register a
ma / `aSet mark a / jump to mark a
qa ... q / @aRecord macro a / replay it
Files & windows5
:w :q :wq :q!Save / quit / save+quit / force-quit
:e fileOpen a file
:sp / :vspHorizontal / vertical split
Ctrl-w h/j/k/lMove between splits
:bn / :bp / :lsNext / prev buffer / list buffers