The Vi Editor - Novell LINUX ENTERPRISE SERVER 10 - INSTALLATION AND ADMINISTRATION 11-05-2007 Installation Manual

Table of Contents

Advertisement

17.4 The vi Editor

Text editors are still used for many system administration tasks as well as for program-
ming. In the world of Unix, vi stands out as an editor that offers comfortable editing
functions and is more ergonomic than many editors with mouse support.
17.4.1 Operating Modes
NOTE: Display of Keys
In the following, find several commands that you can enter in vi by just pressing
keys. These appear in uppercase as on a keyboard. If you need to enter a key
in uppercase, this is stated explicitly by showing a key combination including
the Shift key.
Basically, vi makes use of three operating modes: insert mode, command mode, and
extended mode. The keys have different functions depending on the mode. On start-up,
vi is normally set to the command mode. The first thing to learn is how to switch between
the modes:
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.
358
Installation and Administration

Advertisement

Table of Contents
loading

This manual is also suitable for:

Suse linux enterprise server 10

Table of Contents