vi editing commands

2009 Mar 01


i
I
insert text before cursor
insert text before beginning of line
a
A
append text after cursor
append text after end of line
o
O
open line after current line and insert
open line before current line and insert
r
R
replace character
overwrite characters
cw
cc
cmotion
C
change word
change current line
change test from cursor to target of motion
change to end of line
s
S
substitute: delete char and insert
delete current line and insert
x
X
delete char at cursor
delete char before cursor
dw
dW
dd
dmotion
D
delete word
delete word to white space
delete current line
delete lines from current line to target of motion
delete to end of line
yw
yy
"ayy
ymotion
yank (copy) word
yank current line
yank current line into named buffer a
yank text between cursor and target of motion
p
P
"aP
put deleted/yanked line(s) before current line
put deleted/yanked line(s) after current line
put text from buffer a (a-z) before cursor
. repeat last edit command
u
U
undo last edit
restore current line
J join current and next line
ZZ write (save) and exit

2005-2009