next up previous contents
Next: EMACS Up: Editing Files Previous: Editing Files

vi

 

Vi was a visual (screen oriented) interface placed on top of a line editor. In the words of the Jargon file, it was crufted together by Bill Joy (of Sun Microsystems fame). It is a quite small program, and is often used to do small, quick jobs. If you look closely at the actual program that poses as vi, you may find that it is actually vim (Vi IMproved), stevie, vile, elvis, or something else.

Vi is a ``moded'' editor, having command and data modes. There are several commands to get into data mode (append after cursor (a), append at end-of-line (A), insert before cursor (i), insert at beginning-of-line (I)). There is only one way to get out of data mode, and that is to hit the escape key. If you hit the escape key while in command mode, typically the computer beeps (or the screen flashes if the visual bell has been set). So it is not uncommon to here a computer beep a lot if someone is using vi.

Typical of many things UNIX, vi has many very cryptic commands. They tend to be one or two characters long, which often leads to some strange pneumonic to remember them. Vi also predates the arrow keys on a keyboard: not only can you use the arrow keys to move (in command mode), but you can also use the ``hjkl'' keys to move left, down, up and right respectively.

The write (w) command will write your changes to disk, the quit (q) command will quit vi (if you don't have any pending changes), the QUIT! (q!) command will quit you from vi whether you have pending changes or not.

Newer versions of vi have a special command called ``help'', which brings up some documentation meant to be help.


next up previous contents
Next: EMACS Up: Editing Files Previous: Editing Files

Gordon Haverland
Sat Oct 9 13:50:48 MDT 1999