UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: 8.8 Miscellaneous CommandsChapter 8
The vi Editor
Next: 8.10 Setting Up vi
 

8.9 Alphabetical List of Keys

For brevity, control characters are marked by ^.

^]Perform a tag look-up on the text under the cursor.
aAppend text after cursor.
AAppend text at end of line.
^AUnused.
bBack up to beginning of word in current line.
BBack up to beginning of word, ignoring punctuation.
^BScroll backward one window.
cChange operator.
CChange to end of current line.
^C

Unused in command mode; ends insert mode (stty interrupt character).

dDelete operator.
DDelete to end of current line.
^D

Scroll down half-window (command mode).

Move backward one tab-stop (insert mode).

eMove to end of word.
EMove to end of word, ignoring punctuation.
^EShow one more line at bottom of window.
fFind next character typed forward on current line.
FFind next character typed backward on current line.
^FScroll forward one window.
gUnused.
GGo to specified line or end of file.
^GPrint information about file on status line.
hLeft arrow cursor key.
HMove cursor to Home position.
^HLeft arrow cursor key; Backspace key in insert mode.
iInsert text before cursor.
IInsert text before first nonblank character on line.
^IUnused in command mode; in insert mode, same as Tab key.
jDown arrow cursor key.
JJoin two lines.
^JDown arrow cursor key; in insert mode, move down a line.
kUp arrow cursor key.
KUnused.
^KUnused.
lRight arrow cursor key.
LMove cursor to last position in window.
^LRedraw screen.
mMark the current cursor position in register (a-z).
MMove cursor to middle position in window.
^MCarriage return.
nRepeat the last search command.
NRepeat the last search command in the reverse direction.
^NDown arrow cursor key.
oOpen line below current line.
OOpen line above current line.
^OUnused.
pPut yanked or deleted text after or below cursor.
PPut yanked or deleted text before or above cursor.
^PUp arrow cursor key.
qUnused.
QQuit vi and invoke ex.
^QUnused (on some terminals, resume data flow).
rReplace character at cursor with the next character you type.
RReplace characters.
^RRedraw the screen.
sChange the character under the cursor to typed characters.
SChange entire line.
^SUnused (on some terminals, stop data flow).
tMove cursor forward to character before next character typed.
TMove cursor backward to character after next character typed.
^T

Return to the previous location in the tag stack (Solaris vi command mode).

If autoindent is set, indent another tab stop (insert mode).

uUndo the last change made.
URestore current line, discarding changes.
^UScroll the screen upward half-window.
vUnused.
VUnused.
^VUnused in command mode; in insert mode, quote next character.
wMove to beginning of next word.
WMove to beginning of next word, ignoring punctuation.
^W

Unused in command mode; in insert mode, back up to beginning of word.

xDelete character under cursor.
XDelete character before cursor.
^XUnused.
yYank or copy operator.
YMake copy of current line.
^YShow one more line at top of window.
z

Reposition line containing cursor. z must be followed either by: Return (reposition line to top of screen), . (reposition line to middle of screen), or - (reposition line to bottom of screen).

ZZExit the editor, saving changes.
^ZSuspend vi (only works on systems that have job control).


Previous: 8.8 Miscellaneous CommandsUNIX in a Nutshell: System V EditionNext: 8.10 Setting Up vi
8.8 Miscellaneous CommandsBook Index8.10 Setting Up vi

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System