http://users.binary.net/dturley/vi.html
(2003-11-12)
This list was hastily put together for my own use.
Perhaps you'll find it useful as well.
Input mode: set insertion point [back to top] | |
i | insert text at cursor |
a | append text after cursor |
I | insert text at beginning of time |
A | append text at end of line |
o | open line below cursor |
O | open line above cursor |
Deletion and Change: delete/change words or character [back to top] | |
dw | delete a single word |
cw | change a word |
dd | delete entire line |
R | replace line |
D | delete from curosor position to end of line |
C | change from cursor position eo end of line |
x | delete a single character |
r | replace a character |
Cursor movement: position the cursor [back to top] | |
l | move right |
h | move left |
j | move down |
k | move up |
$ | move to end of line |
^ | move to beginning of line |
w | move to next word |
e | move to end of word |
1G | move to first line |
nG | move to line n |
G | move to last line |
Screen movement: move a screen at a time [back to top] | |
ctrl-d | scroll forward half a screen |
ctrl-u | scroll back half a screen |
ctrl-f | move to next screen |
ctrl-b | move to previous screen |
ctrl-l | redraw screen |
Last line mode: used when ending an editing session [back to top] | |
:w | write buffer |
:q | quit |
:q! | force quit without saving |
:wq | write and quit (save) |
:n | next file |
:r | read file |
:e | edit file |
:f | file name |
:set | file name |
:set no | set options off |
:! | escape to shell |
:n | go to line n |
Miscellaneous [back to top] | |
u | undo last action |
/ | search forward |
? | search back |
N | search back (alternate) |
n | repeat search |
. | repeat last command |
yy | yank line |
p | put below cursor |
P | put above cursor |
ZZ | write and quit |