8. The Vi Editor
Contents:
This section presents the following topics:
8.1 Review of Vi OperationsThis subsection provides a review of the following:
For more information on vi , refer to the Nutshell Handbook Learning the vi Editor . 8.1.1 Command-line SyntaxThe three most common ways of starting a vi session are:
You can open 8.1.2 Command ModeOnce the file is opened, you are in command mode. From command mode, you can:
8.1.3 Insert ModeIn insert mode, you can enter new text in the file. Press the ESCAPE key to exit insert mode and return to command mode. The following commands invoke insert mode:
8.1.4 Syntax of Vi CommandsIn vi, commands have the following general form:
The basic editing
If the current line is the object of the operation, then the operator
is the same as the object: An object can represent any of the following text blocks:
8.1.4.1 Examples
8.1.5 Status-line CommandsMost commands are not echoed on the screen as you input them. However, the status line at the bottom of the screen is used to echo input for the following commands:
Commands that are input on the status line must be entered by
pressing the RETURN key.
In addition, error messages and output from the |
|