A highly opinionated vim cheat sheet.
- selecting:
v: start selecting charactersV: selects the whole line
- action:
d: to cuty: to copyp: to paste after the cursorgp: to paste after the cursor and then move the cursor at the end of the pasted textP: to paste before the cursorgP: to paste before the cursor and then move the cursor at the end of the pasted text
u: undo last changeCtrl-R: redo last undone change
w: move to the start of the next worde: move to the end of the current or next wordb: move to the start of the current or previous word
Note: upper case next word motions (e.g.
W) will consider"word"as being 1 WORD, instead of 3 words.
f: move to the next character occurence in the current linet: move one character before the next character occurence in the current line;: repeats the previous inline motion
Note: upper case inline motions (e.g.
F) will move to previous occurence.
Ctrl-W v: creates a new vertical splitCtrl-W s: creates a new horizontal splitCtrl-W q: closes the current splitCtrl-W h: switches the right splitCtrl-W l: switches the left split
Ctrl-N: autocomplete word