BELUG > vi > previous

vi Features

Many Linux users avoid using vi because of their bewildering and frustrating initial experience with it. vi is definitely not intuitive -- at least for neophytes. Particularly confusing to new users is their inability to simply begin typing away when vi starts, in contrast to conventional text editors and word processors.

However, vi gradually becomes easier to use after practice. In fact, its adherents claim that it is extremely fast and efficient once you become accustomed to it, and many people come to miss its power in situations where they have to use other text editors.

Although vi's role as the standard Linux and Unix editor may be to some extent an accident of history, this editor also has features which definitely merit its continued popularity and widespread use:

  • It is present in almost every Linux Unix system, even the most minimal.

  • It is very small. In fact, some versions have a total code size of less than 100KB. This makes it easy to include vi on even the tiniest versions of Linux, such as those in embedded systems and those that run from a single floppy disk.

  • It is typist-friendly, at least once you get used to it. For example, the commands are very short, usually just a few keystrokes. And because vi does not use the mouse, there is never any need to remove one's hands from the keyboard. This can speed up editing substantially.

  • It is very powerful, as just a few very short commands can make sweeping changes to large documents. In fact, vi is more powerful than most of its users realize, and few of them know more than just fraction of all the commands.

Even if you are not going to use it as your main editor, becoming familiar with vi can still be a good investment. For example, many Unix tools, applications and games employ a subset of vi's commands. This includes some of the best diagnostic and forensic tools, even those for use with other operating systems such as Microsoft Windows. Moreover, vi is often the only editor still available for use while trying to repair a damaged Linux or Unix system that retains only minimal functionality.

vi has a total of approximately 150 basic commands. However, it is only necessary to know about a dozen of them in order to be able to use it effectively. And you can become really fast after you have learned about two dozen. This tutorial covers enough commands to make you a fairly accomplished vi user and set you on your way to becoming a true Linux/Unix geek.