Show Menu
Cheatography

vi Keyboard Shortcuts (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Modes

Command Mode
The editor begins in command mode, where the cursor movement and text deletion and pasting occur.
Insertion Mode
Begins upon entering an insertion or change command. [ESC] returns the editor to command mode

Quitting

:x
Exit, saving changes
:y
Exit as long as there have been no changes
ZZ
Exit and save changes if any have been made
:q!
Exit and ignore any changes

Inserting Text

i
Insert before cursor
I
Insert before line
a
Append after cursor
A
Append after line
o
Open a new line after current line
O
Open a new line before current line
r
Replace one character
R
Replace many characters
 

Motion

h
j
k
l
w
W
b
B
e
E
(
)
{
}
0
$
1G
G
nG
Move to nth line of the file
:n
Move to nth line of the file
fc
Move forward to c
Fc
Move back to c
H
Move to top of screen
M
Move to middle of screen
L
Move to botton of screen
%
Move to associated ( ), { }, [ ]