Cheatsheet for quick reference of vim commands
|
Save changes
|
w
|
|
Close file
|
q
|
|
Save and close file
|
wq
|
|
Close file and abandon changes
|
q!
|
|
a
|
Append
|
|
A
|
Append from the end of the line
|
|
i
|
Insert (mode)
|
|
o
|
Next line
|
|
O
|
Previous line
|
|
s
|
Delete character and insert
|
|
S
|
Delete line and insert
|
|
C
|
Delete until end of line and insert
|
|
r
|
Replace one character
|
|
R
|
Enter replace mode
|
|
u
|
Undo changes
|
|
Ctrl+R
|
Redo changes
|
|
x
|
Delete character
|
|
dd
|
Cut line
|
|
yy
|
Yank line
|
|
p
|
Paste
|
|
P
|
Paste before
|
|
"+p
|
Paste from system clipboard
|
|
Ctrl + U / Ctrl + D
|
Half page up/down
|
|
Ctrl + B / Ctrl + F
|
Page up
|
|
b / w
|
Previous / next word
|
|
ge / e
|
Preview / next end of word
|
|
0
|
Start of line
|
|
$
|
End of line
|
|
^
|
Start of line after whitespace
|
|
fc
|
Go forward to character 'c'
|
|
Fc
|
Go backward to character 'c'
|
|
gg
|
First line
|
|
G
|
Last line
|
|
:n
|
Go to line 'n'
|
|
zz
|
Center this line
|
|
zt
|
Top this line
|
|
zb
|
Bottom this line
|
|
H
|
Move to top of the screen
|
|
M
|
Move to middle of the screen
|
|
L
|
Move to bottom of the screen
|
|
n
|
Next matching search pattern
|
|
N
|
Previous matching search pattern
|
|
*
|
Next whole word under cursor
|
|
#
|
Previous whole word under cursor
|
|
p
|
Paragraph
|
|
y
|
Yank copy
|
|
c
|
Delete and then insert
|
|
>
|
Right indent
|
|
<
|
Left indent
|
|
g~
|
Swap case
|
|
gU
|
Uppercase
|
|
gu
|
Lowercase
|
|
dw
|
Delete to next word
|
|
db
|
Delete to beginning of word
|
|
2dd
|
Delete 2 lines
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.