Features of Vi and Vim Explained with Differences

This tutorial explains the features of Vi and Vim text editors in Linux. Learn differences between the Vi and Vim editors in detail.

Vi is a visual text editor. Before visual editors, there were line editors which used to operate on a single line of text at a time. To use a line editor you have to tell the line editor to go to a particular line and describe what change you want to make, such as adding or deleting text.

With the advent of video terminals, visual editing became possible. Vi was created to allow editing on a video terminal with a moving cursor. Vi derives its name from the word visual. The first version of vi was written in 1976 by Bill Joy.

Line editors, instead of giving a complete overview of a text file, used to show only the current line that the user was working with. Vi was the first editor that worked in a mode where the complete text file was displayed which made it possible to move back and forward between lines.

Because of this, in the text editors' historical context, Vi was a big achievement that prepared a base for several modern visual text editors. One such a modern text editor is Vim. Vim is purely based on Vi. Vim stands for Vi-Improved, the user-friendly version of Vi.

Vim is written by Bram Moolenaar. It is a substantial improvement over traditional Vi. Since Vi is quite difficult, most Linux distributions don't include real Vi; rather, they include Vim and symbolically link (or alias) the Vim to the name Vi.

Which version of Vi is installed?

The easiest way to know which version (traditional or improved) of Vi is installed, is running the vi command without any argument and option.


If the output of this command displays a bunch of tildes (~) marking empty lines and a line of status at the bottom of the screen, traditional version of Vi is installed. The following image shows the output of this command when the traditional version of Vi is installed.

vi installed

If the improved version of Vi is installed and linked with the traditional 'vi' command, the output of this command will display information about it. The following image shows the output of this command when the improved version of Vi is installed.

vi linked with vim

To quit from the output, press Esc key and type :q! and hit the Enter key.

exit from vi or vim

Another simple way to know whether the Vim is installed or not is running the vim command. If command runs successfully, Vim is installed. If it returns the 'command not found' error message, Vim is not installed.

The following image shows the output of vim command when Vim is installed.

vim installed

The following image shows the output of vim command when Vim is not installed.

vim not installed

If Vim is not installed, you can install it just like any other Linux package. For example to install Vim on Ubuntu, use the following command.

$sudo apt install vim

The following image shows the sample output of the above command.

apt install vim

Vi editor V/s Vim editor

As far as functionality is concerned, both editors work in the same manner. Which editor you choose is a matter of personal choice. If you are learning from scratch, you should learn the Vim editor instead of the Vi editor. Due to added features, learning and using Vim editor is much easier than the Vi editor. Since Vim is based on the Vi, when you will learn how to use the Vim editor, you will automatically learn how to use the Vi editor.

Differences between Vi and Vim editors

Vim adds the following features and functions to the existing functionality of Vi.

  • It includes more features for the programming languages such as; syntax highlighting, code folding, text formatting, etc.
  • It includes an inbuilt utility for comparing files.
  • It includes the undo/redo facility.
  • It supports external scripting languages.
  • It can edit compressed files.
  • It can edit remote files over the network protocol.
  • It supports plugins for additional functionality.
  • It supports screen splitting for editing multiple files simultaneously.

Who should learn Vi or Vim?

Vi and Vim are complex editors. These editors are quite difficult to learn and use. You might wonder, why you should bother to learn Vi or Vim while there are so many easy-to-use and featured-rich text editors available.

Well… it depends on what type of user you are.

If you are a user who mostly works on the graphical environment and creates or edits text files that only contain user data, or if you are a user who asks someone else to repair the system then you may neglect these editors.

But if you are a user who mostly works on the command line or manages the Linux file system or accesses a Linux system remotely, or if you are a person who is called upon to repair the system then you should learn these editors.

In more simple words, to perform all your tasks if you only use the Linux desktop environment on a standalone Linux system, you do not need to learn Vi or Vim editors. But if you are a Linux system administrator or a network administrator or use the command line to access a remote Linux system, you must learn Vi or Vim editors.

Vi - an editor of administrators

Administrators learn Vi mainly for the following reasons.

  • Vi is the universal editor of Linux. No matter which Linux distribution you use, or which version of the distribution you use, it contains the Vi editor. Therefore, if an administrator knows how to use the Vi editor, he can edit text files on any Linux system.
  • Vi is always available in every mode of Linux. In many situations, such as emergency mode and a remote session, Vi is the only available editor. If an administrator does not know how to use Vi, then editing configuration files in such mode would be a nightmare for him.
  • Vi is the lightest and fastest editor. Vim has a small footprint in RAM and on the CPU. For many tasks, Vi is easier to use than to load and use a heavy graphical text editor. Vi is designed for typing speed. A skilled vi administrator never has to lift his or her fingers from the keyboard while editing.
  • Some system administration commands are built on Vi. For example, edquota (a command that limits available disk space for users on your server), visudo (a command that sets permissions for the sudo command), and crontab –e (a command that schedules a task to run at a given moment in time). These commands are macros built on Vi. Learning the Vi helps to use and manage these commands more effectively.

This article is the first part of the article "How to use Vi and Vim text editors on Linux". Other parts of this article are the following.

Vi and Vim Modes Explained through Examples

This is the second part of this article. It explains how to navigate between different modes of the Vi and Vim.

Vi and Vim Text Editors commands Explained

This is the third part of the article. It explains all essential Vi and Vim text editors' commands in detail through examples.

That's all for this tutorial. In the next part of this tutorial, we will learn the modes of Vi and Vim in detail through examples. If you like this tutorial, please don't forget to share it with friends through your favorite social channel.

ComputerNetworkingNotes Linux Tutorials Features of Vi and Vim Explained with Differences