The vi is a text editor. It is small, powerful,
and standard on most UNIX systems. The vi often frustrates new
users with a unique distinction between its two modes: Command
Mode and Insert/Overtype Mode. This distinction,
although difficult to become accustomed to for many users, provides
great power and ability to the editor. Insert/Overtype Mode is
designed for inserting text only. All text manipulations and cursor
moving should be done from with in Command Mode.
Entering the vi
Insert/Overtype Mode is solely for entering text.
To leave one of these two modes press the [ESC] key.
if you wish to enter the ESC character or any other
control character while in insert mode: type
[CONTROL]-V and then the control sequence. The only
difference between Insert Mode and Overtype Mode is that characters
are placed in front of the text after the cursor in Insert Mode, where
as existing characters are overwritten in Overtype Mode.
Entering Insert Mode
- vi commands follow the general form:
- which means:
operator n times on m
objects. If n and/or m are
omitted, they default to 1.
- Operators which take objects are(if the operator is pressed twice
then the object is the current line)
#The operators <, >, and ! are line based so
the set of
objects is diminished greatly.
- Operators which do not take objects:
- Objects (if given with out an operator are interpreted as a
cursor motion command):
- ex commands in the vi follow this general form:
- which means:
- Execute command on specific lines obtained from the
address part of the general form. If
is omitted, current line is used. Keep in mind that the ex
is a line based editor, so all actions are line based.
- Some commands are:
The vi environment variables
- You can customize your environment with this command by typing
set var=value, this will set the specified
value for a scalar variable.
For boolean variables, use
set var to set and
set novar to unset. You can see which variables
are set by just typing the
set by its self.
You can see a list of all variables by typing
set all. Some environment variables are specific to
the ex editor and some are specific to the vi
editor. I have included both.
File Saving and Loading
1 It is noteworthy to add that most
control sequences are bound in the vi. I do not mention them
here because they remind me of emacs and I hope to spare you such
2 For the record, no
animals were physically harmed during the testing of these examples;
although some elephants are now in psychological therapy as a direct
result of my actions. I kind of feel guilty about that one :(
I hope you liked my vi reference manual, if you have any
questions or suggestions then feel free to send
- Last modified: 29 March 02000
- About the author:
- William Totten
Copyleft: (C) 1996 2000, William Totten