Cheatsheet
Every command in the curriculum, filterable and searchable. Click a card to open its example with the editor running.
67 commands
i
Insert before cursor
i then type → INSERT mode
a
Insert after cursor
a → cursor moves one right
o
Open a new line below
o → new blank line + INSERT
O
Open a new line above
O → new blank line above
Esc
Return to NORMAL mode
or Ctrl-[
h j k l
Left, down, up, right
5j → move down 5 lines
┌
┐
└
┘
AD · cheatsheet-native
fluid · In-grid
// google adsense slot
w
Jump to next word
3w → 3 words forward
b
Jump to previous word
b → start of prev word
e
End of word
e → end of current word
0
Start of line
0 → column 1
Ctrl-
First non-blank of line
^ → first real char
$
End of line
$ → last char
gg
Jump to first line
gg → top of file
G
Jump to last line
G or {n}G
f x
Jump forward to char x in line
f( → next (
{
Previous paragraph
{ → up one paragraph
}
Next paragraph
} → down one paragraph
n
Repeat last search forward
n → next match
N
Repeat last search backward
N → previous match
*
Search word under cursor (forward)
* → next same word
#
Search word under cursor (backward)
# → prev same word
x
Delete character under cursor
x → delete one char
dd
Delete (cut) line
2dd → delete 2 lines
dw
Delete word
d3w → delete 3 words
d$
Delete to end of line
d$ or D
yy
Yank (copy) line
5yy → copy 5 lines
p
Paste after cursor
p → paste below
P
Paste before cursor
P → paste above
u
Undo last change
u u u → keep going
Ctrl-r
Redo (Ctrl-r)
Ctrl-r → redo undone
.
Repeat the last change
. → reapply last edit
r x
Replace char under cursor with x
r$ → replace with $
cw
Change word (delete + INSERT)
cw newword Esc
X
Delete char before cursor
X → backspace-delete
D
Delete to end of line
D = d$
C
Change to end of line
C → erase to EOL + INSERT
cc
Change whole line
cc → clear line + INSERT
s
Substitute char (delete + INSERT)
s → replace one char
S
Substitute line (clear + INSERT)
S = cc
R
REPLACE mode (overtype)
R → type over text, Esc to stop
J
Join line below onto this one
J → 'a' + ' ' + 'b'
~
Toggle case of char
~ → a ↔ A, move right
>>
Indent line
>> → add one indent
<<
Dedent line
<< → remove one indent
v
Enter VISUAL (char) mode
v → select chars
V
Enter VISUAL LINE mode
V → select whole lines
Ctrl-v
VISUAL BLOCK (Ctrl-v)
Block-select columns
gv
Reselect last selection
gv → reselect
:w
Save file
:w → write to disk
:q
Quit current window
:q! to force quit
:wq
Save and quit
:wq or ZZ
:e file
Open file in current buffer
:e src/app.py
/text
Search forward
/foo → n / N to cycle
:s/a/b/g
Substitute on current line
:%s/a/b/g for whole file
?text
Search backward
?foo → search upward
:%s/a/b/g
Substitute in the whole file
:%s/old/new/g
:g/pat/d
Delete all lines matching a pattern
:g/DEBUG/d
iw
Inside word
ciw → change a word
aw
Around word (includes space)
daw → delete word + space
i"
Inside double quotes
ci" → change string
i(
Inside parens
di( → delete args
it
Inside HTML/XML tag
cit → change tag contents
ip
Inside paragraph
dip → delete paragraph
ap
Around paragraph (incl. blank line)
dap → delete paragraph + gap
at
Around HTML/XML element
dat → delete the whole tag
i{
Inside braces (multi-line)
di{ → empty a code block
a(
Around parens (incl. delimiters)
da( → delete a call's args