![]() ![]() ![]() ![]() |
|||
![]() |
![]() |
||
|
Learn IT : Software Documentation : Unix-vi | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
vi is a text editing program which allows you to create and edit files in UNIX. vi is the default text editor in Elm, a UNIX mail program. There are various operating modes (Command, Text Input, and Last Line) which allow you to create or edit files, add or delete specific lines or characters within files, or even search for specified patterns within files.
Creating
or Opening a File
Entering the text editor is fairly simple: at the UNIX prompt, type vi filename, where filename is the name of the file you wish to edit or create. If the specified filename already exists, the vi editor will open the document. If the specified filename does not exist, the vi editor will create a file with that name. The vi editor will start in Command mode. Entering Text In order to enter text, you will first need to enter
the Text Input mode. Pressing the Escape key will return you to Command
mode.
vi launches in Command mode. Command mode allows you
to move through, and edit, a document. When in another mode, press
the Escape key to return to Command mode. To cancel an uncompleted
command code, press Escape. Quitting vi is another Command mode code,
which is covered at the end of this document.
From Command mode you can access the Last Line mode,
which allows you to perform searches and save, amongst other things.
Certain character sequences (:,/, ?, and !!)
enable the switch from Command mode, acting as prefixes for Last Line
commands.
There are a few ways to quit vi, depending on what you
intend to do. Remember to press the Escape key first, if you are not
in Command mode.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||