Linux

How To Install Vim on Ubuntu

In this tutorial, we will cover the various methods and techniques we can use to install and configure the Vim editor on Ubuntu.
Captain Salem 3 min read
How To Install Vim on Ubuntu

Vim is a highly configurable and extensible text editor designed for efficient text editing. It is a modal editor, meaning that it has different modes for editing and navigating text, allowing users to perform complex editing tasks with minimal keystrokes.

Vim is written in C and is available on a variety of operating systems, including Unix, Linux, and Windows. It is often a popular choice among programmers and system administrators for editing source code, configuration files, and other types of text-based files. Vim offers a wide range of features, including syntax highlighting, auto-completion, macro recording, plugin support, and many more.

Requirements

  • An Ubuntu System
  • Administrative permissions to install and configure packages.
  • Ncurses Lib
  • Network Connection
  • Build Tools such as git, make, build-essentials, gcc, etc.

Method 1 - Install Vim Via Package Manager

The simplest and most straightforward method to have Vim on your Ubuntu system is to use the default package manager.

Start by updating the repository index with the command:

sudo apt-get update

Next, run the command below to install Vim.

sudo apt-get install vim -y

This command should download the latest Vim editor and configure it on your system.

Method 2 - Installing Vim (Snap)

We can also use the Ubuntu snap system to install the vim editor on your system. Ensure the snap system is installed with the command:

sudo apt update && sudo apt install snapd

Install Vim with the command:

sudo snap install --classic vim

Method 3 - Build Vim

You can also manually build the Vim package from source. Start by installing the required packages with the command:

sudo apt install libncurses5-dev libncursesw5-dev git make gcc build-essential -y

The command above will the required packages such as ncurses, git, make, gcc, build-essential, etc.

The next step is to download Vim from the official repository. You can run the command below to clone the repo:

git clone https://github.com/vim/vim.git

Once the repository has been cloned, navigate into the src directory and run the make command as:

cd vim

Make:

sudo make

This will initialize the build process.

Once the build process is complete, run the command below to install and configure Vim on your system.

sudo make install

You can verify by running the command:

vim -v

Confirm the installed version.

How to Uninstall Vim

To remove Vim, we can run the command:

sudo apt remove vim -y

Or:

sudo make uninstall

Conclusion

In this tutorial, you discovered how you can install Vim editor on your Ubuntu system using APT, SNAP, and Make. We hope you enjoyed this tutorial.

You can check out other tutorials shown below to expand your knowledge.

How to Install MySQL on Ubuntu 20.04: A Step-by-Step Guide
In this article, you will learn how to install MySQL on Ubuntu, set up security installation, and run scripts on the MySQL console.
How to install hwdata in Ubuntu
In this article, we will show you how you can install the `hwdata` package in Ubuntu systems.
How to Install the Java PPA on Ubuntu
In this short post, you will find the easy steps to install JDK 11 on Ubuntu using PPAs.

If you enjoy our content, please consider buying us a coffee to support our work:

Share
Comments
More from GeekBits

Join us at GeekBits

Join our members and get a currated list of awesome articles each month.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to GeekBits.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.