Recall that c
, d
, and y
are the basic editing operators.
a | Append after cursor. |
A | Append to end of line. |
i | Insert before cursor. |
I | Insert at beginning of line. |
o | Open a line below cursor. |
O | Open a line above cursor. |
Esc | Terminate insert mode. |
CTRL-J | Move down one line. |
Return | Move down one line. |
CTRL-I | Insert a tab. |
CTRL-T | Move to next tab setting. |
Backspace | Move back one character. |
CTRL-H | Move back one character. |
CTRL-U | Delete current line. |
CTRL-V | Quote next character. |
CTRL-W | Move back one word. |
cw | Change word. |
cc | Change line. |
C | Change text from current position to end of line. |
dd | Delete current line. |
ndd | Delete n lines. |
D | Delete remainder of line. |
dw | Delete a word. |
d} | Delete up to next paragraph. |
d^ | Delete back to beginning of line. |
d/ pat | Delete up to first occurrence of pattern. |
dn | Delete up to next occurrence of pattern. |
df a | Delete up to and including a on current line. |
dt a | Delete up to (but not including) a on current line. |
dL | Delete up to last line on screen. |
dG | Delete to end of file. |
p | Insert last deleted text after cursor. |
P | Insert last deleted text before cursor. |
r x | Replace character with x. |
R text | Replace with new text (overwrite), beginning at cursor. |
s | Substitute character. |
4s | Substitute four characters. |
S | Substitute entire line. |
u | Undo last change. |
U | Restore current line. |
x | Delete current cursor position. |
X | Delete back one character. |
5X | Delete previous five characters. |
. | Repeat last change. |
~ | Reverse case. |
Y | Copy current line to new buffer. |
yy | Copy current line. |
" xyy | Yank current line to buffer x. |
" xd | Delete into buffer x. |
" Xd | Delete and append into buffer x. |
" xp | Put contents of buffer x. |
y]] | Copy up to next section heading. |
ye | Copy to end of word. |
Buffer names are the letters a
-z
. Uppercase names append text to the specified buffer.