- Choosing an Editor
- Starting pico and Dabbling with It
- Saving in pico
- Cutting and Pasting Text Blocks in pico
- Checking Spelling in pico
- Getting Help in pico
- Exiting pico
- Starting vi and Dabbling with It
- Saving in vi
- Adding and Deleting Text in vi
- Importing Files into vi
- Searching and Replacing in vi
- Exiting vi
- Starting emacs and Dabbling with It
- Using emacs Menus to Spell-Check
- Saving in emacs
- Exiting emacs
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. Some systems "helpfully" open a new window and give 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:
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.
This morning I got up, went downstairs, 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. See Table 4.4 for a brief summary of the most useful commands in emacs.
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