Esc
| Change from Insert
mode to Command mode
|
Ctrl-Z
| Suspend vi process
(fg to resume)
|
:wq
| Normal exit, saving
file first (Alternate form: ZZ)
|
:w
| Save current file (write
to disk)
|
:q!
| Quit (abnormal exit)
? restore state to last write
|
Ctrl-F
| View next screen
|
Ctrl-B
| View previous screen
|
Ctrl-L
| Repaint screen (Alt:
Ctrl-R)
|
l
| Advance one char (Alt:
arrow keys or Space/Backspace)
|
h
| back up one char (Alt:
arrow keys or Space/Backspace)
|
w
| Advance one word (Capitalize
to skip puncuation)
|
b
| back up one word (Capitalize
to skip puncuation)
|
j
| Advance vertically
(Alt: arrow keys or Ctrl-N/Ctrl-P)
|
k
| Back up vertically
(Alt: arrow keys or Ctrl-N/Ctrl-P)
|
:n
| Go to line n
|
H
| Go to highest line
of screen
|
M
| Go to middle line of
screen
|
L
| Go to lowest line of
screen
|
0
| Go to start of current
line
|
$
| Go to end of current
line
|
(
| Go to start of current
sentence
|
)
| Go to start of next
sentence
|
1G
| Go to top of file
|
G
| Go to bottom of file
|
u
| Undo last change
|
U
| Restore current line
|
i
| Insert left of cursor
|
O
| Open line (and enter
Insert mode) above current line
|
o
| Open line (and enter
Insert mode) below current line
|
a
| Append (insert) after
cursor
|
A
| Append (insert) at
end of current line
|
J
| Join the next line
to the end of the current line
|
Ctrl-D
| Unindent relative to
previous line (Insert mode, at line start)
|
x
| Delete current character
|
X
| Delete previous character
|
dw
| Delete rest of current
word
|
dd
| Kill entire line
|
P
| Paste before cursor
the contents of last delete
|
p
| Paste after cursor
the contents of last delete
|
"np
| Paste below current
line nth (1st thru 9th) delete from last
|
"bdd
| Delete line into buffer
b (26 lettered buffers)
|
"bp
| Paste contents of buffer
b
|
:rfile
| Read in (insert) file
|
:efile
| Edit another file
|
/pattern
| Search forward for
pattern
|
?pattern
| Search backward for
pattern
|
n
| Repeat previous search
in same direction
|
N
| Repeat previous search
in opposite direction
|
:g/old/s//new/g
| Multiple replacements
|
:g/old/s//new/c
| Interactive replacements
|
:s/old/new
| Substitute for first
occurence in line
append /g, /c for global, interactive substitution
|
cwtext
| Change remainder of
word to text (end with )
|
:map x macro
| Define character x
as macro ? cf. reference!
|
@b
| Execute (as macro)
contents of buffer b ? cf. reference!
|