Unix for Mac OS X 10.4 Tiger: Visual QuickPro Guide (2nd Edition)

Saving a File in vi

vi offers features similar to the familiar Save and Save As features found in most Macintosh applications.

To begin, you must be in command mode. All save commands in vi begin with a colon . This drops the cursor to the last line of your Terminal window and tells vi you are about to enter a command that affects the entire file.

You will see that many vi commands begin by the user 's typing a colon ( : ). If the cursor doesn't drop to the status line when you type a colon, then you have forgotten to switch to command mode. In those cases, delete (press ) the colon you inserted and press .

You always press at the end of vi commands that start with a colon.

To save the current file:

To save the file with a new filename:

Tip

To save and attempt to override warnings:

Категории