For brevity, control characters are marked by ^.
Command |
Action |
---|---|
a |
Append text after cursor. |
A |
Append text at end-of-line. |
^A |
Search for next occurrence of word under cursor. Increment number in vim when cursor is on a number. |
b |
Back up to beginning of word in current line. |
B |
Back up one word, treating punctuation marks as words. |
^B |
Scroll backward one window. |
c |
Change text up to target of next movement command. |
C |
Change to end of current line. |
^C |
End insert mode; interrupts a long operation. |
d |
Delete up to target of next movement command. |
D |
Delete to end of current line. |
^D |
Scroll down half-window; in insert mode, unindent to shiftwidth if autoindent is set (or when using vim). |
e |
Move to end of word. |
E |
Move to end of word, treating punctuation as part of word. |
^E |
Show one more line at bottom of window. |
f |
Find next character typed forward on current line. |
F |
Find next character typed backward on current line. |
^F |
Scroll forward one window. |
g |
Unused in vi. Begins many multiple-character commands in vim. |
G |
Go to specified line or end-of-file. |
^G |
Print information about file on status line. |
h |
Left arrow cursor key. |
H |
Move cursor to home position. |
^H |
Left arrow cursor key; Backspace key in insert mode. |
i |
Insert text before cursor. |
I |
Insert text before first nonblank character on line. |
^I |
Unused in command mode; in insert mode, same as Tab key. |
j |
Down arrow cursor key. |
J |
Join previous line to current line. |
^J |
Down arrow cursor key; in insert mode, move down a line. |
k |
Up arrow cursor key. |
K |
Unused in vi. Look up word using keywordprg in vim. |
^K |
Unused in vi. Insert multiple-keystroke character in vim. |
l |
Right arrow cursor key. |
L |
Move cursor to last position in window. |
^L |
Redraw screen. |
m |
Mark the current cursor position in register (a-z). |
M |
Move cursor to middle position in window. |
^M |
Move to beginning of next line. |
n |
Repeat the last search command. |
N |
Repeat the last search command in reverse direction. |
^N |
Down arrow cursor key. |
o |
Open line below current line. |
O |
Open line above current line. |
^O |
Unused in vi. Return to previous jump position in vim. |
p |
Put yanked or deleted text after or below cursor. |
P |
Put yanked or deleted text before or above cursor. |
^P |
Up arrow cursor key. |
q |
Unused in vi. Record keystrokes in vim. |
Q |
Quit vi and enter ex line-editing mode. |
^Q |
Unused in vi. Same as ^V in vim (On some terminals, resume data flow.) |
r |
Replace character at cursor with the next character you type. |
R |
Replace characters. |
^R |
Redraw the screen. |
s |
Change the character under the cursor to typed characters. |
S |
Change entire line. |
^S |
Unused. (On some terminals, stop data flow.) |
t |
Find next character typed forward on current line and position cursor before it. |
T |
Find next character typed backward on current line and position cursor after it. |
^T |
Unused in command mode for vi. Pop tag from tagstack in vim. In insert mode, move to next tab setting. |
u |
Undo the last change made. In vi, a second undo redoes an undone command. vim supports multiple levels of undo. To redo, use Ctrl-R. |
U |
Restore current line, discarding changes. |
^U |
Scroll the screen upward a half-window. |
v |
Unused in vi. Enter visual mode in vim. |
V |
Unused in vi. Enter linewise visual mode in vim. |
^V |
Unused in command mode for vi. Enter blockwise visual mode in vim. In insert mode, insert next character verbatim. |
w |
Move to beginning of next word. |
W |
Move to beginning of next word, treating punctuation marks as words. |
^W |
Unused in command mode in vi. Begins window commands in vim. In insert mode, back up to beginning of word. |
x |
Delete character under cursor. |
X |
Delete character before cursor. |
^X |
Unused in vi. Decrement number in vim when cursor is on a number. In insert mode in vim, begins several commands. |
y |
Yank or copy text up to target of following movement command into temporary buffer. |
Y |
Make copy of current line. |
^Y |
Show one more line at top of window. |
z |
Reposition line containing cursor. z must be followed by Return (reposition line to top of screen), . (reposition line to middle of screen), or - (reposition line to bottom of screen). |
ZZ |
Copyright © 2003 O'Reilly & Associates. All rights reserved.