A vi Reference Sheet

The vi (pronounced vee-eye) editor was developed
by the University of California - Berkleley. While vi is a somewhat complex
editor (virtually every key on the keyboard has a function), it is the
one editor that you can be sure will be installed on a machine. With that
said, it is a good idea to at least have a working knowledge of vi. To
put yourself into command mode <Esc> needs to be pressed.
This will allow you to execute the following commands.

Running vi

vifilename

opens filename in vi. If the file does not exist vi creates it.

Entering Text

i

Start inserting at the cursor position. All characters typed will be
inserted until <Esc> is pressed.

a

Start appending text after the cursor position. All characters typed
are inserted until <Esc> is pressed.

Moving Cursor

h, j, k, l

Moves cursor, left, down, up, and right. The arrow keys *may* work
on some systems.

$

Move cursor to the end of the current line.

:1

Go to line 1. Entering another number in place of 1 will bring you
to that line instead.