Differences Between Vi And Vim Text Editors Explained

Vi and Vim are both text editors available in Linux. This tutorial explains the differences between them in detail.

Vi is the universal text editor of Linux. If you know how to use the Vi text editor, you can edit any text file on any mode and version of Linux. Vim is simply an improved version of Vi, but unlike Vi, Vim is not universal.

Depending on your Linux distro, it may be or may not be installed by default. But let’s start with a little bit of history first.

A Brief History of Vi and Vim

Vi traces its origins back to the command line editor called ed. Ed was the original Unix text editor. The original Vi was developed in the late 1970s by Bill Joy, a graduate student at the University of California at Berkeley.

Later he co-founded Sun Microsystems and server as Chief Scientist until 2003. Joy first developed ex as an improved line editor that supported a superset of ed commands. He then developed vi as a “visual interface” to ex.

Vim (a contraction of Vi IMproved) is a text editor written by Bram Moolenaar and first released publicly on November 2, 1991. When he had bought an Amiga computer, he wanted to use the editor he learned on Unix.

Since there was no good Vi for the Amiga, he started with the best available and started improving it. His goal was to imitate Vi. Later new functionality was added, and by version 1.22, Vim included more features than Vi. It was renamed from Vi IMitation to Vi IMproved.

Differences Between Vi and Vim

Vi is the standard text editor. It is the classic and most popular text editor in the Linux family that comes built-in in most Linux distributions.

Vim is a vi-like editor but is more advanced and powerful than the original Vi. It has many features that Vi does not, even features that are not “advanced.” Let’s now see what the main differences between them are.

vi vs vim

Unlimited Undo

One of the best features of the Vim editor is multilevel undo, meaning you can undo changes multiple times. For example, if you accidentally delete a line of text, delete a second line, and then the third one, you can undo each of the four deletes. On the other hand, Vi editor does not support multilevel undo.

Syntax Highlighting

Indeed, one of the key selling points of Vim over Vi is its syntax highlighting. Vim can be programmed to highlight portions of the buffer in different colors or styles based on the edited file type. This improvement over Vi comes in handy for programmers using Vim to write/edit code.

GUI / Visual Operations

Vim works well at a console, but it can run natively in many GUIs. It is designed for use from a command-line interface and as a standalone application in a graphical user interface. Vim uses native GUI widgets for scrolling and dividing buffers and has mouse support.

Portable Configurations

Vim’s configurations are portable. In addition, Vim text editor enables you to import the same configurations on different Linux systems.

Plugins

Vim support plugins. Plugins extend the current features of Vim. New features can be easily added from 3’rd parties without changing the main and official Vim code base.

Flexible Insert Mode

Vi editor does not allow navigation using arrow keys while in insert mode. That makes Vi editor inconvenient to navigate around in insert mode. On the other hand, the Vim editor allows navigation using arrow keys in insert mode.

Conclusion

Vi comes preinstalled with just about every UNIX/Linux system out there. Functionally, Vim is almost a proper superset of Vi. Therefore, everything that is in Vi is available in Vim.

But there is genuine quite a big difference between them. Vim has more of everything. These additional features give Vim an edge over the original Vi editor.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%