Vi Editor Commands
Vi Editor Commands
Vi Editor Commands
Quick links...
General Startup
Counts
Cursor Movement
Screen Movement
Inserting
Deleting
Copying Code
Put Command
Find Commands
Miscellaneous Commands
Line Editor Mode
ex Commands
Substitutions
Reading Files
Write File
Moving
Shell Escape
General Startup
To use vi: vi filename
To exit vi and save changes: ZZ or :wq
To exit vi without saving changes: :q!
To enter vi command mode: [esc]
Counts
Cursor Movement
h
move down
move up
[return]
Screen Movement
G
xG
move to line x
z+
z-
^F
^B
^D
^U
^R
redraw screen
( does not work with VT100 type terminals )
^L
redraw screen
( does not work with Televideo terminals )
Inserting
r
Deleting
x
dd
dw
db
Copying Code
yy
Put Command
brings back previous deletion or yank of lines,
words, or characters
P
Find Commands
?
repeat last f, F, t, T
Miscellaneous Commands
.
xp
^G
mx
'x
ex Commands
For a complete list consult the
UNIX Programmer's Manual
READING FILES
copies (reads) filename after cursor in file
currently editing
:r filename
WRITE FILE
:w
:#
move to line #
:$
MOVING
SHELL ESCAPE
executes 'cmd' as a shell command.
:!'cmd'