Show Menu
Cheatography

Cheatsheet for quick reference of vim commands

Exiting

Save changes
w
Close file
q
Save and close file
wq
Close file and abandon changes
q!

Editing

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

Clipboard

x
Delete character
dd
Cut line
yy
Yank line
p
Paste
P
Paste before
"+p
Paste from system clipboard
 

Navigating

Ctrl + U / Ctrl + D
Half page up/down
Ctrl + B / Ctrl + F
Page up

Navigating [words]

b / w
Previous / next word
ge / e
Preview / next end of word

Navigating [lines]

0
Start of line
$
End of line
^
Start of line after whitespace

Navigating [chara­cters]

fc
Go forward to character 'c'
Fc
Go backward to character 'c'

Navigating [document]

gg
First line
G
Last line
:n
Go to line 'n'

Navigating [window]

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

Navigating [search]

n
Next matching search pattern
N
Previous matching search pattern
*
Next whole word under cursor
#
Previous whole word under cursor
 

Visual mode operators

p
Paragraph
y
Yank copy
c
Delete and then insert
>
Right indent
<
Left indent
g~
Swap case
gU
Uppercase
gu
Lowercase

Deleting

dw
Delete to next word
db
Delete to beginning of word
2dd
Delete 2 lines

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          Bash/ZSH Shourtcuts Cheat Sheet
          bash Shortcuts Cheat Sheet