Publishers of technology books, eBooks, and videos for creative people

Home > Articles

  • Print
  • + Share This
This chapter is from the book

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

Figure 4.12 Save early, save often. That's the safe rule for vi.

To save text in vi:

  • esc.jpg:w limerick

    Press esc.jpg 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 enter.jpg. If you've already saved the file once, just press esc.jpg and type :w, then press enter.jpg.

  • + Share This
  • 🔖 Save To Your Account