How to Install VIM text Editor on Ubuntu?

There are many text editors on Ubuntu. Some of them are powerful enough to be used to write code for some programming language. Others are more simple and serve their purpose well. However, others are used from the terminal and make it ideal for server management. One of them is Vim Text Editor. And in this post, you will learn how to install it in Ubuntu 20.04 and 18.04

Vim text editor

Vim is a Vi-compatible text editor designed to be used in the terminal. The acronym of Vim comes from Vi Improved which gives us a sample of what the program wants. Like any Ubuntu text editor, it is possible to edit plain texts as well as a script or even code is written from a terminal. This makes it especially useful for server administration or remote computers. All this without affecting the performance of the equipment because it is a very light program.

So if you want to use it and you don’t have it installed, we will tell you how to do it.

Install Vim text editor on Ubuntu

The procedure is quite simple to apply. First, you open a terminal. In case it is using a server, then, connect to it using SSH:

When the terminal session is open, refresh APT to avoid scattered packets that could affect the installation.

sudo apt update

When finished and with the package database updated, you can do a search for Vim in the repositories.

sudo apt-cache search vim | grep editor
Vim Related packages
Vim Related packages

As you can see on the screen output, there are many packages related to Vim. It is not necessary to install all of them but it is good to know them to realize that it is possible to add more functionality to Vim.

So to install Vim, you can run the following command:

sudo apt install vim

If you want to confirm the installation, you only need to run some commands with Vim. For example, you can show the version that has been installed.

vim --version
Vim on Ubuntu
Vim on Ubuntu

If you want to open a file with Vim, just run the command and give it the file path.

vim [file-path]

Sample Output:

Vim sample output
Vim sample output

If it does not exist, the program will create it temporarily until you save the changes.


In this tutorial, you have quickly learned how to install Vim text editor on Ubuntu. Remember that this tutorial will work for both Ubuntu 20.04 and 18.04 which makes it versatile.

Vim is an application that helps to edit texts quickly from the terminal. This makes it very useful for servers or where you don’t want to spend a lot of resources.

Vim website

Also you can read:

The 3 best text editors for Linux

Scroll to Top