No discussion of VI or VIM is complete without also mentioning Emacs. VI and Emacs are the two most popular editors on the UNIX platform, and many heated debates have been held over which one is "best". Choose whichever one you feel most comfortable with, as being comfortable with the editor you use will help you code more efficiently.
Emacs is a text editor and more. At its core is a Lisp derivative with extensions to support text editing, called elisp. Just like VIM, it has syntax coloring, split windows, visual selection, a graphical user interface (with menus, mouse control, scrollbars, text selection, and the like), and much more. There are also a large number of extensions which add other functionality (most of which aren't installed on the lab machines). To edit a file with Emacs, type:
emacs [file...]
Unlike VIM, Emacs is not a mode-oriented editor. Insert mode is always active, and commands are triggered only by combinations of modifier keys (such as CTRL and ALT) and other keys. Sometimes a series of key combinations need to be entered to perform an action: for example, CTRL-x followed by CTRL-c exits the editor (and prompts for modified files to be saved).
Following is a summary of the commands Emacs accepts. To conserve space in this summary, CTRL is designated by "C", ALT is designated by "A", and META is designated by "M".
Pressing one of the arrow keys moves the cursor one position in the direction of the arrow. Pressing the PgUp key moves backward in the file by a full screen; pressing the PgDn key moves forward in the file by a full screen.