Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Notes:
denotes the Esc key, and <CR> denotes the Enter key.
<ESC>
The expression <cmd> means that you should enter a command, <f> means that
you should enter a filename, and <x> means that you should enter a character or
number.
The symbol ^ (caret) means that you should hold down the Ctrl key while
pressing the indicated letter.
Ex mode commands:
q Quit set <x> Enable option q! Quit, discard changes set no<v> Disable option r <f>
Read in file <f> set all Show all options sh Invoke shell vi Vi mode wq Write and quit w
<f> Write file <f> w! <f> Overwrite file <f>
Options:
autoindent Automatic line indentation autowrite Write before quit ignorecase Ignore case
in searches number Display line numbers showmatch Show matches to ) and } as typed
terse Quiet mode wrapscan Wraparound in searches wrapmargin Automatic line splitting
Also see:
vi Editor Commands
Quick links...
General Startup
Counts
Cursor Movement
Screen Movement
Inserting
Deleting
Copying Code
Put Command
Find Commands
Miscellaneous Commands
Line Editor Mode
ex Commands
Substitutions
Reading Files
Write File
Moving
Shell Escape
General Startup
To use vi: vi filename
To exit vi and save changes: ZZ
or :wq
To exit vi without saving changes: :q!
To enter vi command mode: [esc]
Counts
A number preceding any vi command tells vi to repeat
that command that many times.
Cursor Movement
move down
move up
[return]
Screen Movement
xG
move to line x
z+
z-
^F
^B
^D
^U
^R
redraw screen
( does not work with VT100 type terminals )
^L
redraw screen
( does not work with Televideo terminals )
Inserting
Deleting
dd
dw
db
Copying Code
yy
Put Command
brings back previous deletion or yank of lines,
words, or characters
Find Commands
repeat last f, F, t, T
Miscellaneous Commands
xp
^G
mx
'x
ex Commands
For a complete list consult the
UNIX Programmer's Manual
READING FILES
copies (reads) filename after cursor in file
currently editing
:r filename
WRITE FILE
:w
:#
move to line #
:$
MOVING
SHELL ESCAPE
executes 'cmd' as a shell command.
:!'cmd'