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
Cursor Movement
h move left (backspace)
j move down
k move up
current line
current line
punctuation mark
or punctuation mark
B move to the beginning of the previous word,
ignores punctuation
Screen Movement
xG move to line x
^R redraw screen
^L redraw screen
Inserting
character typed
Deleting
Copying Code
multiple lines.
Put Command
words, or characters
Find Commands
; repeat last f, F, t, T
Miscellaneous Commands
second (swap)
ex Commands
READING FILES
currently editing
:r filename
WRITE FILE
MOVING
:# move to line #
SHELL ESCAPE
:!'cmd'