next up previous contents
Next: Pico Up: Editing Files Previous: vi

EMACS

 

Consulting the Jargon file again, EMACS is a programmable text editor with an entire LISPgif system inside it. It was originally written by Richard M. Stallman (RMS) in TECO under the ITS operating system. Some clones of RMS emacs are: GOSMACS, CCA EMACS, UniPress EMACS, jove, epsilon and MicroEMACS.

Emacs can have just about every functionality imaginable for an editor installed optionally. It can edit directories, it knows the structure of a tar file, there are many mail and news readers for it, there is a world wide web browser mode for it, it can calculate phases of the moon, there is a psychoanalyst built in, .... Notable extentions to emacs are special modes for editing source code files for various computer languages: C, FORTRAN, LISP, perl, SGML, LaTeX, ....

Most commands are executed by holding down the control or escape key and then hitting one or more other keys. A whole bunch of commands can be executed from the Esc-X command, which pops up a one line command line.

Using ``C'' to signify the control key, and ``M'' for the escape (meta) key, some usable commands are:

C-x C-s
Save the file.
C-x C-c
Exit emacs.
C-v
Down one page.
M-v
Up one page.
M-<
Go to beginning of file.
M->
Go to end of file.
C-f
Forward one position.
C-b
Backward one position.
C-e
Go to end of line.
C-a
Go to beginning of line.
C-p
Go to previous line.
C-n
Go to next line.

And hundreds (thousands?) of other commands.

Of course, you can use the arrow keys to move in their indicated directions if you choose to.

Emacs understands what a word, sentence or paragraph is, and so you can move the cursor by words, sentences or paragraphs. It can search for things in either direction as either a fixed string, or by using regular expressions. You can also search incrementally.

The GNU Info system uses a read-only mode of emacs for displaying information.

There is something of a holy war in terms of vi versus emacs as an editor. There is no correct answer as to whether you should use one or the other. They are very different editors. It has been said that people with long fingers should use emacs. Try it, see if you like it. You should at least use it a couple of times so that you get some familiarity with the info system.

Emacs also has help built in, hitting M-X help-with-tutorial (getting to the Meta-X command line, and then typing in help-with-tutorial) may be the best way to get to know emacs.


next up previous contents
Next: Pico Up: Editing Files Previous: vi

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