- Choosing an Editor: nano/pico or vi/vim
- Starting nano and Dabbling with It
- Saving in nano
- Cutting and Pasting Text Blocks in nano
- Checking Spelling in nano
- Getting Help in nano
- Exiting nano
- Starting vi (or vim) and Dabbling with It
- Saving in vi
- Adding and Deleting Text in vi
- Importing Files into vi
- Searching and Replacing in vi
- Exiting vi
Saving in vi
You’ll want to save changes to your documents frequently, especially as you’re learning to use vi . Until you’re accustomed to switching between insert and normal mode, you may accidentally type in commands when you think you’re typing text, with unpredictable results. To save files, just follow these steps.
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 .