Escolar Documentos
Profissional Documentos
Cultura Documentos
Command Syntax
Legend: [ ] optional
| choice (or)
( ) group
[count]command
[count]search_command [character|string]
["buffer_name][count]yank_command|change_command|delete_command|shift_command|put_com
mand
["buffer_name][count]yank_prefix|change_prefix|delete_prefix|shift_prefixsame_prefix
["buffer_name][count]yank_prefix|change_prefix|delete_prefix|shift_prefix[count]cursor_movemen
t
Buffers Available
Unnamed buffer
Named buffers: a to z (replace)
A to Z (append)
Numbered buffers: 1 to 9 (push down deletes)
Input Commands
A append to end of line C change to end of line
a input text after cursor c change prefix, change through
cursor movement
I input before first character on line O open new line above current line
i input text before cursor location o open new line below current line
S replace characters on current line <ctrl>? (delete) interrupt the editor
returning to
s substitute character cursor is on with command mode
following string <ctrl>{ (escape) cancel partial
command, exit
insert mode
~ change case of letter character the cursor is on
Delete Commands
D delete to end of line X delete character before the cursor
d delete prefix, delete through cursor movement x delete character cursor is on
Undo Commands
U restore current line to condition before changes
u undo last single change made to text dd deletes the line the cursor is on.
Miscellaneous Commands
! filter lines from file through a UNIX command
& repeat last ex substitute command
J join current line and subsequent line
Q quit vi mode returning to ex mode
ZZ exits the editor, saving any changes if needed
# followed by a number, acts a function key
= reindents line for lisp
m mark cursor location with following character
. repeat the last command that changed the contents of the file
<ctrl>G print file stats
<ctrl>V during insert, "quote" next character
<ctrl>@ during insert, repeat last insert and end, 128 characters maximum
<ctrl>Q during insert, "quote"next character
<ctrl>^ return to previous position in last edited file
Cursor Movement Commands
space move cursor right one character ` move cursor to beginning of marked
line
$ move cursor to the end of the line % move cursor to matching parenthesis,
bracket or brace
Options/Parameters
autoindent automatically indent next line to same indent level
autowrite automatically write file to disk when changing files
directory= specify directory in which temporary files are created
errorbells precede error messages with a bell if no standout mode
hardtabs= define spacing between hardware tab settings
lisp automatically indent lisp code properly
magic enable use of regular expression characters in searches
ITDC Open Systems Education - www.itdc.edu - 800.752.5448
The vi Editor - A Complete Reference
number show line numbers
paragraphs= specify macro names that indicate start of paragraph
readonly set the read-only flag so that changes cannot be saved