© 2010 Go Squared Ltd.
VI Help Sheet GoSquared
Download this Help Sheet now at gosquared.com/liquidicity
Put it on your wall
Modes & Controls
Command Mode
Insertion Mode
ESC (commands preceded by :)
Entered on insertion or change
Inserting Text
i
I
a
A
o
O
R
r
Insert before cursor
Insert before line
Append after cursor
Append after line
Add new line after current line
Add new line before current line
Overwrite one character
Other
u
J
nJ
.
U
:N
Undo last change
Join lines
Join next n lines
Repeat last command
Undo all changes to line
Open split screen
v
Visual mode
ctrl + c
Escape insert mode
vi <!lename>
vi -r <!lename>
vi + n <!lename>
vi + <!lename>
vi +/str <!lename>
:w
:x
:q
:q!
Save & Exit
Exit if no changes made
Exit & discard any changes
In insertion mode the following should be preceded by ESC:
Save
Edit !lename
Edit last version of !lename after crash
Edit !lename at line n
Edit !lename at end of !le
Edit !lename at !rst occurance of str
Overwrite many characters
:r <!le> Reads !le and inserts it after this line
Cursor Navigation
h or
k or
j or
l or
w
W
B
b
Cursor left
Cursor up
Cursor down
Cursor right
Next word
Next blank delimited word
Start of word
Start of blank delimited word
e End of word
E
(
)
{
0
}
End of blank delimited word
Back a sentence
Forward a sentence
Back a paragraph
Forward a paragraph
Beginning of line
$ End of the line
1G
G
:n
f<char>
H
Start of !le
End of !le
nth line of !le
Forward to char
Back to char
Top of screen
M Middle of screen
L
%
Bottom of screen
Matching bracket
gg Start of document
F<char>
Deleting Text
x
D
X
dd or :d
ndw
ndb
:x,yd
ndd
Delete character to right of cursor
Delete the rest of line
Delete character to left of cursor
Delete current line
Deletes the next n words
Deletes the previous n words
Deletes n lines starting with current
Delete lines x through y
:r <!le> Reads !le and inserts it after this line
Referenced from http://www.lagmonster.org/docs/vi.html
p Put after the position or line
P Put before the position or line
C Rewrite the whole line
d{na