Quitting vi

Quitting vi

As much as you probably love using vi , sooner or later you will want to do something else, maybe anything else. Knowing when and how to quit is one of life's great lessons. Quitting from vi is pretty easy, as long as you have saved all your changes. You can combine saving and quitting if you like. If you try to quit from vi with unsaved changes, vi will give you a warning on the status line ( Figure 6.13 ). You can override the warning if you want to quit without saving.

Figure 6.13. vi gives you a warning on the status line if you try to quit while leaving unsaved changes.

To quit vi if you have saved all changes:

  • :q

    vi quits and returns to the shell prompt.

    If you forgot to save any changes, then vi displays a warning message in the status line and does not quit.

To combine saving and quitting:

  • :wq

    The file is saved, and vi quits.

To quit without saving:

  • :q!

    vi quits even if there are unsaved changes to the file.

BBEditan Excellent Text Editor

The BBEdit program is a GUI text editor. Available in both "lite" freeware and full-featured commercial versions, BBEdit is a powerful tool for editing plain-text files such as HTML, programming source code, and Unix text files.

The commercial version will allow you to perform all your Mac OS X system-administration tasks . Because it is a commercial version, we did not use it as the primary editor discussed in this bookwe don't want you to have to buy something else in order to use this book. Still, we heartily recommend BBEdit lite to anyone who works with plain-text files on a Mac.

BBEdit is available from Bare Bones Software (www. barebones .com).




Unix for Mac OS X 10. 4 Tiger. Visual QuickPro Guide
Unix for Mac OS X 10.4 Tiger: Visual QuickPro Guide (2nd Edition)
ISBN: 0321246683
EAN: 2147483647
Year: 2004
Pages: 161
Authors: Matisse Enzer

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