Novell LINUX ENTERPRISE DESKTOP 10 SP2 - DEPLOYMENT GUIDE 08-05-2008 Deployment Manual page 395

Table of Contents

Advertisement

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.
15.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.
Press Esc to switch from insert mode to command mode. In command mode, move the
cursor with H , J , K , and L . The keys have the following functions:
H
Move one character to the left
J
Move one line down
K
Move one line up
L
Move one character to the right
The commands in command mode allow diverse variations. To execute a command
several times, simply enter the number of repetitions before entering the actual command.
For example, enter 5 L to move the cursor five characters to the right.
A selection of important commands is shown in
vi Editor"
(page 380) This list is far from complete. More complete lists are available
in the documentation found in
Table 15.2, "Simple Commands of the
Section 15.4.3, "For More Information"
(page 381)
Working with the Shell
379

Advertisement

Table of Contents
loading

This manual is also suitable for:

Linux enterprise desktop 10 sp2

Table of Contents