VI Editor - Introduction

There are many ways to edit files in Unix. Editing files using the screen-oriented text editor vi is
one of the best ways. This editor enables you to edit lines in context with other lines in the file.
An improved version of the vi editor which is called the VIM has also been made available
now. Here, VIM stands for Vi IMproved.
vi is generally considered the de facto standard in Unix editors because

• It's usually available on all the flavors of Unix system.
• Its implementations are very similar across the board.
• It requires very few resources.
• It is more user-friendly than other editors such as the ed or the ex.
• You can use the vi editor to edit an existing file or to create a new file from scratch. You
can also use this editor to just read a text file.
o vi stands for Vim Improved.
o Vi uses number of internal commands to navigate to any point in a text file and edit text
there.
o It also allows us to copy and move the text within the file and also from one file to
another.
o We can use internal commands for editing work.
o It makes complete use of keyboard where practically every key has a function.
o To create any vi file,

$ vi <some text or filename>

o If file doesn’t exist, vi provides us a full screen with the filename shown at the bottom
with the qualifier [New File].
o The cursor is positioned at top and all remaining lines of the screen (Except last) show
a ~. We can’t take cursor there because they are nonexistent lines.
o The last line is reserved for commands that we can enter to act on the text. This line is
also used by the system to display the message.

General Command Information

As mentioned previously, vi uses letters as commands.
It is important to note that in general vi commands:

• are case sensitive - lowercase and uppercase command letters do different
things
• are not displayed on the screen when you type them
• Generally do not require a Return after you type the command.

You will see some commands which start with a colon (:). These commands are ex commands
which are used by the ex editor. Ex is the true editor which lies underneath vi -- in other words,
vi is the interface for the ex editor.

Limitations of VI editor

vi editor has weak environment s there are some disadvantages of it as below:
1. vi is case-sensitive.
2. It don't display error message when something is going wrong. At that moment, only
beep sound of speaker which informs you there is something wrong.
3. There is no online help available in vi.
4. It works on 3 different modes. Same keys can create different effect on each mode.



Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post