VimQuest
LV1 INITIATE · 0 XP

CHEATSHEET

Every motion and operator this trainer teaches.
MOVEMENT
h j k lcharacter / line motionLeft, down, up, right. The home row.
wnext wordJump to the start of the next word.
bprevious wordJump back to the start of the previous word.
eend of wordJump to the last character of the next word.
W B EWORD motionsSame as w/b/e but punctuation does not split words.
0start of lineJump to column zero.
^first non-blankJump to the first non-whitespace character.
$end of lineJump to the last character of the line.
ggtop of fileJump to the first line.
Gbottom of fileJump to the last line. With a count, to that line.
{ }paragraphJump to the previous or next blank line.
%match bracketJump between matching (), [] or {}.
f x / t xfind / tillFind the next x on the line, or stop just before it.
F x / T xfind / till backwardSame, searching backwards.
; ,repeat findRepeat the last f/t motion, forwards or backwards.
countmultiplier3w, 5j, 2dd — almost every command takes a count.
EDITS
x / Xdelete characterDelete under the cursor, or before it.
r xreplace characterReplace the character under the cursor.
ssubstitute characterDelete the character and enter insert mode.
ddelete operatord + motion. dd deletes the line, dw a word, d$ to the end.
cchange operatorLike d but drops you into insert mode.
yyank operatorCopy. yy copies the line.
p / PputPaste after, or before, the cursor.
D / Cdelete / change to endShortcut for d$ and c$
cc / Schange lineClear the line and insert.
INSERT
iinsertInsert before the cursor.
aappendInsert after the cursor.
Iinsert at startInsert at the first non-blank character.
Aappend at endInsert at the end of the line.
o / Oopen lineOpen a new line below or above.
<Esc>normal modeAlways come back. Insert is a visit, normal is home.
TEXT OBJECTS
iw / awword objectdiw deletes a word, daw deletes it plus a space.
i" a" i' a'quote objectci" changes what is inside the quotes.
i( a( i[ i{bracket objectdi( deletes the contents of the parentheses.
ip / apparagraph objectdip deletes the whole paragraph.
VISUAL
vvisual modeSelect characters with motions, then d / c / y.
Vvisual lineSelect whole lines.
oswap endsMove the cursor to the other end of the selection.
ADVANCED
" a-znamed register"ayy yanks into register a, "ap pastes it.
u / <C-r>undo / redoStep back and forward through changes.
.repeatRepeat the last change. The best key in vim.
q a ... qrecord macroRecord keystrokes into register a.
@ a / @@play macroReplay a recorded macro, @@ repeats the last one.
:wthe classicThis is a game. Your progress saves itself.