Using vi

vi is a very simplistic (read stupid) editor that is very quick and lightweight to use. It is available on all unix platforms.

vi has two modes, insert mode and command mode. In insert mode, everything you type is inserted into the file. You exit insert mode using the escape key. In command mode, each letter you type performs some command. One command you can use is i, which starts insert mode wherever you are in the file.

You can start vi with the command

   vi new-file
Which will create a new file named new-file and start you in insert mode at the top of the new file.

You can also start vi with the command

   vi old-file
Which will open the existing file named old-file and start you in command mode at the top of the new file.

You can also start vi with the command

   view old-file
Which will open the existing file named old-file and not let you save any changes to the file.

The following vi commands are useful:

The command ZZ will save your file and exit.

There are also : commands to control your vi session. Typing a : in command mode opens a line at the bottom of the screen where a command may be entered. The entire command must be entered, followed by an <enter> or <return> key to execute the command. The following : commands may be useful at some time: