Novell LINUX ENTERPRISE SERVER 10 SP2 - INSTALLATION AND ADMINISTRATION Installation Manual page 395

Hide thumbs Also See for LINUX ENTERPRISE SERVER 10 SP2 - INSTALLATION AND ADMINISTRATION:
Table of Contents

Advertisement

Command Mode to Insert Mode
There are many possibilities, including A for append, I for insert, or O for a new
line under the current line.
Insert Mode to Command Mode
Press Esc to exit the insert mode. vi cannot be terminated in insert mode, so it is
important to get used to pressing Esc .
Command Mode to Extended Mode
The extended mode of vi can be activated by entering a colon (:). The extended or
ex mode is similar to an independent line-oriented editor that can be used for various
simple and more complex tasks.
Extended Mode to Command Mode
After executing a command in extended mode, the editor automatically returns to
command mode. If you decide not to execute any command in extended mode,
delete the colon with <— . The editor returns to command mode.
It is not possible to switch directly from insert mode to extended mode without first
switching to command mode.
vi, like other editors, has its own procedure for terminating the program. You cannot
terminate vi while in insert mode. First, exit insert mode by pressing Esc . Subsequently,
you have two options:
1. Exit without saving: To terminate the editor without saving the changes, enter : –
Q – ! in command mode. The exclamation mark (!) causes vi to ignore any changes.
2. Save and exit: There are several possibilities to save your changes and terminate
the editor. In command mode, use Shift + Z Shift + Z . To exit the program saving
all changes using the extended mode, enter : – W – Q . In extended mode, w stands
for write and q for quit.
18.4.2 vi in Action
vi can be used as a normal editor. In insert mode, enter text and delete text with the <—
and Del keys. Use the arrow keys to move the cursor.
However, these control keys often cause problems, because there are many terminal
types that use special key codes. This is where the command mode comes into play.
Working with the Shell
377

Advertisement

Table of Contents
loading

This manual is also suitable for:

Suse linux enterprise server 10 sp3

Table of Contents