Published on

Actually Useful Vim

Authors

A list of Vim commands that you'll actually use.

Movement

SyntaxDescription
h j k lMove the cursor up, down, left, right
e wMove forwards to end of word, move forwards to the start of a word
bMove backwards to start of word
i aInsert/append, goes to the left/right side of current character
I AInsert at the beginning of the line, append at the end of the line
o OInsert line below/above
%Jump to matching parenthesis/quote
f[CHAR]Jumps to next occurrence of [CHAR]
[NUMBER]GJumps to line [NUMBER]
g_Jumps cursor to the last non-whitespace character in the line

Editing

SyntaxDescription
dDeletes. Can combine with movement, i.e. dw deletes the word to the right of the cursor, db deletes to the left of the cursor
x XDeletes single character before/after cursor
dawDeletes the entire word under the cursor
c[i/a][DELIMITER]Select everything inside DELIMITER (such as "" or (), and DELIMITER = w means current word), and replace it (enters INSERT mode). Using i means inner, i.e. the word inside the delimiter, while a will include the delimiter
v[i/a][DELIMITER]Same thing as above but selects (visually) instead of changing the word