To enter an ex command from vi, type:
An initial : indicates an ex command. As you type the command, it is echoed on the status line. Execute the command by pressing the Enter key. address is the line number or range of lines that are the object of command. options and addresses are described below. ex commands are described in the next section Alphabetical Summary of ex Commands in Alphabetical Summary of ex Commands.
You can exit ex in several ways:
Exit (save changes and quit).
Quit without saving changes.
Switch to the vi editor on the current file.