9. The Ex Editor
Ex is a line editor that serves as the foundation for the screen editor vi. Ex commands work on the current line or on a range of lines in a file. Most often, you use ex from within vi. In vi, ex commands are preceded by a colon and entered by pressing RETURN.
But you can invoke ex on its own-from the command line-just as you would invoke vi. (You could execute an ex script this way.) You can also use the vi command Q to quit the vi editor and enter ex.
This section presents the following topics:
For more information, see the Nutshell Handbook Learning the vi Editor .
9.1 Syntax of Ex Commands
To enter an ex command from vi, type:
indicates an ex command.
As you type the command, it is echoed on the status line.
Enter the command by pressing RETURN.
You can exit ex in several ways:
If no address is given, the current line is the object of the command. If the address specifies a range of lines, the format is:
9.1.3 Address Symbols
See Section 6 for more information on using patterns.