- 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
Saving in vi
You'll want to save changes to your documents frequently, especially as you're learning to use vi (Figure 4.12). Until you're accustomed to switching between command and input mode, you may accidentally type in commands when you think you're typing text, with unpredictable results. To save files, just follow these steps.
Figure 4.12 Save early, save often. That's the safe rule for vi.
To save text in vi:
Press to get out of input mode and into command mode, then type :w (for "write," as in write to the disk) followed by a space and then the filename (limerick, in this example) you want to use for the file, then press . If you've already saved the file once, just press and type :w, then press .