emacsan Editor Without Modes

emacsan Editor Without Modes

The emacs editor was invented by Richard M. Stallman, who is better known today as the founder of the Free Software Foundation and the GNU project.

emacs is what's known as a modeless editoryou don't have to switch back and forth between command mode and edit mode. emacs is not quite as widely used as vi , but it is very popular, and even though it's a large application with many features, its basics are actually easier than vi 's.

To start emacs:

  • emacs filename

    emacs starts up. Like vi , emacs is a full-screen editor that fills your Terminal window. Figure 6.19 shows a Terminal window after starting emacs .

    Figure 6.19. emacs is another full-screen editor.

To move around in the file:

  • Use the arrow keys.

To change text:

  • Type to insert text; to remove text, press . emacs automatically wraps lines for you.

To save changes:

1.


emacs commands use the key. Most commands consist of two (or more) control characters . The save command is , followed immediately by . (That means do not press or any other key between this step and the next one.)

2.


The file is saved.

To quit:

1.


Like the save command, the quit command is a pair of combinations: followed by .

2.


If there are unsaved changes, emacs asks if you want to save ( Figure 6.20 ).

Figure 6.20. If you attempt to quit from emacs with unsaved changes, you will be asked if you want to save.

To save changes, type y ; to abandon changes, type n .

You can find more information about emacs on the man page ( man emacs ), which includes instruction on running an interactive tutorial feature from within the emacs program.

Tip

  • If you want to see an example of why emacs is way different from other commands we have shown you, try this: Start emacs , press , and then type hanoi -unix and press . You will see a text-based display of solving of the classic Towers of Hanoi problem. The emacs program is really a complete environment for interacting with your machine, far more than simply a text editor. Remember that to quit, you press and then .




Unix for Mac OS X 10. 4 Tiger. Visual QuickPro Guide
Unix for Mac OS X 10.4 Tiger: Visual QuickPro Guide (2nd Edition)
ISBN: 0321246683
EAN: 2147483647
Year: 2004
Pages: 161
Authors: Matisse Enzer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net