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. |
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. |
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. |
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. |
^K | Unused. |
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. |
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. |
Q | Quit vi and enter ex line-editing mode. |
^Q | Unused. (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; in insert mode, move to next tab setting. |
u | Undo the last change made. |
U | Restore current line, discarding changes. |
^U | Scroll the screen upward a half-window. |
v | Unused. |
V | Unused. |
^V | Unused in command mode; 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 insert mode, back up to beginning of word. |
x | Delete character under cursor. |
X | Delete character before cursor. |
^X | Unused. |
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 | Exit the editor, saving changes. |
Copyright © 2001 O'Reilly & Associates. All rights reserved.