Starting emacs and Dabbling with It


Starting emacs and Dabbling with It

For the novice, emacs offers a reasonable middle ground between the user-friendliness of pico and the power of vi (or vim). It's not available on all systems, though, so you'll just have to type in the command to see if you have access to it. (Refer back to Chapter 1 if you don't.)

Using emacs, you can just type, as you'd expect, then use command sequences, which are basically keys, to make emacs do useful things like save, quit, and the like. When you start emacs, it'll probably look very much like Figure 4.17. If you're on a Linux system, which "helpfully" opens a new window and gives you the graphical version, you'll see something like Figure 4.18.

Figure 4.17. emacs starts out with some basic information, but you can just start typing if you want.


Figure 4.18. emacs might helpfully start out in a spiffier interface if you're sitting at the keyboard of a Linux system. You can get the plain variety, though.


To Start emacs:

1.

emacs

At the shell prompt, type emacs. The program starts up and you'll see something like Figure 4.17. The helpful information may or may not be present, but you can ignore it for now at any rate.

2.

This morning I got up, went down stairs, and found a humongous spider in the bathroom. After I quietly composed myself, I looked around the house for something to put him in...the kids' bug catcher thing (nowhere to be found)...a jar...tupperware...a lidded cup...the salad spinner (BwaaaaHaaaHaaa!)....

Type anything you want.

You can use the arrow keys to navigate up and down in the file line by line.

Tips

  • To get help in emacs, type man emacs. See Chapter 1 for more about man pages.

  • If emacs helped you out by starting in the graphical mode, but you want to play along with us in the text mode, use emacs nw to start the program. (The nw flag means "no windows.")

  • emacs uses both keys and the "meta" key to issue commands. PC users should use in place of the meta key (but you should remember that you'll see M+ or Meta+ in most emacs documentation). For those of you using keyboards that actually have a key labeled "Meta," by all means, you should use it when you see . Mac users should use .

  • As useful as emacs is, it does have a few quirks. For example, if you want to access help, you press the key, which issues the command. To fix this idiosyncrasy, enter then normal-erase-is-backspace.


Table 4.4. Handy emacs Commands

COMMAND

FUNCTION

Opens a new file (existing or new)

Undoes the last change

Cancels the current operation

Bails out of menu selections (and other things)

Moves down one page (screen)

Moves up one page (screen)

Moves to the beginning of the file

Moves to the end of the file





Unix(c) Visual Quickstart Guide
UNIX, Third Edition
ISBN: 0321442458
EAN: 2147483647
Year: 2006
Pages: 251

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