How to install Vim on Ubuntu 20.04?

Overview

Among the various clones of a text editor, Vi is called Vim (Vi Improved). Vim is among the top code editors for application development, with features like syntax highlighting and novel editing commands.

Find out how to set up the most recent Vim editor on the Ubuntu Linux operating system in this guide.

Prerequisites

There are certain prerequisites that need to be met before you begin.

  • A sudo user

  • System running Ubuntu

  • The Ncurses library

  • Linux packages for git, make, and build-essential

Get Started

Step 1: Installing Essential Tools

It is essential that prerequisite packages be included in order to install the most recent edition of Vim on Ubuntu.

  • The system has to comply with specific prerequisites before being able to install any program from GitHub. Execute the command given below:

sudo apt-get install libncurses5-dev libncursesw5-dev​

When prompted to continue further, press 'y'. This command installs the two ncurses packages that are required.

  • Following that, use the following command to install git:

sudo apt install git
  • Configure the make tool after installing git.

sudo apt install make
  • Install the build-essential package, which includes the required compiler.

sudo apt install build-essential

When prompted to continue further, press 'y'. You can now install the most recent Vim version from GitHub after giving it a few minutes to finish.

Step 2: Installing Vim Editor

  • Install Vim on your computer by downloading it from the GitHub repository.

sudo git clone https://github.com/vim/vim.git
  • Go to the downloads directory once the system has finished downloading all the files.

cd vim/src
  • Use the make tool to create the program, then go to the terminal and type:

sudo make

Allow the system to complete constructing the program from its original source code.

  • Move the program we just created to its designated place. The documentation and libraries for Vim are included in this step. Enter this command to accomplish the following:

sudo make install

Vim is successfully installed on the system.

Step 3: Verification

  • Check the Vim version on your machine to make sure the installation procedure was successful. Run the following command in the terminal:

vim -v

The editor will launch and display the most recent version of Vim.

Conclusion

This tutorial demonstrated how to set up Ubuntu using the most recent Vim editor. Before you begin building and installing Vim from the repository, make sure you have all the necessary tools accessible.

Last updated