Editors

emacs

A commonly used editor on the UNIX machines is called GNU Emacs . Being able to use the emacs editor effectively will help you write your programs, find errors, and correct them more efficiently. Also, the conventions you learn to use with Emacs can be applied to other programs, such as browsers and command-line editing.

Many people like to use xemacs, which is closely related to emacs.

Emacs provides its own tutorial, which is highly recommended. At the unix prompt type emacs to enter the editor. Once in emacs, press Ctrl-h and then t for the tutorial (or use the menu options if Control-h has already been redefined...Help-->Tutorial).

emacs References:

vi

Another editor, useful because it is found on all UNIX machines, is vi. Run man vi for more information. One way that vi differs from emacs is that you must enter the command "i" to get into insert mode, which emacs is in all the time. There is also vim, Vi IMproved, a programmer's text editor and gvim, a graphical/gui version of vim that looks a lot like emacs. Run man vim for more information and vimtutor for the tutorial. To run vim, just enter vim. To run gvim in an xwindows environment (which we have in the CS Lab), enter gvim at your unix prompt.

Where to get more vi information:

LaTeX

LaTeX (pronounced "lah-tek") is a formatter. You can use any of the above editors and put in formatting instructions that latex can understand in the document, similar to the way you format in html. This way you can make documents more stylized and easier-to-read.

Where to get more latex information:

Changing your default editor

UNIX uses the EDITOR and VISUAL environment variables to determine your default editor. For example, when using mutt or pine, when you get to the part where you type in your mail message, they will start up your default editor.

To see what your default editor is set to, try this:

$ echo $EDITOR
vi
$ echo $VISUAL
vi

If you want to change these, try this (from the bash shell):

$ export EDITOR=vim
$ export VISUAL=vim

If you want to change these permanently, edit your .profile file.