Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Vim on Ubuntu

Install Vim with apt, Snap or from source, and learn how to remove it again.

How-To Guides2 min read18 screenshots

Vim packages

  • vim-tiny is a minimal version, often pre-installed.
  • vim is the standard version.
  • vim-gtk3 is the GUI version (gVim).
  • vim-nox adds scripting support for Python, Perl and Ruby.
  • neovim is a modern rewrite of Vim.

Step 1: Update the package list

sudo apt update
Updating the package list

Step 2: Install Vim

Minimal:

sudo apt install vim-tiny
Installing vim-tiny

Standard:

sudo apt install vim
Installing the standard Vim

GUI version:

sudo apt install vim-gtk3

Step 3: Check it

vim --version
The Vim version

Method 2: Snap

Install snapd if it is missing:

sudo apt install snapd
Installing snapd
sudo snap install --edge vim-editor
Installing Vim with Snap

The command is vim-editor:

vim-editor --version
The Snap Vim version

Method 3: Ubuntu Software

Open Ubuntu Software, search for vim and click Install.

Finding Vim in Ubuntu Software

Method 4: Build from source

Step 1: Install the build tools

sudo apt update && sudo apt install build-essential libncurses-dev git
Installing the build tools

Step 2: Get the source

git clone https://github.com/vim/vim.git
cd vim
Cloning the Vim source

Step 3: Configure and build

./configure --with-features=huge
make
Configuring Vim
Compiling Vim

Step 4: Install

sudo make install
Installing Vim from source

Check it:

/usr/local/bin/vim --version
The Vim version

Open Vim

vim
Vim opened in the terminal

Press i to type, Esc to stop, and type :wq to save and quit, or :q! to quit without saving.

Remove Vim

apt:

sudo apt autoremove vim
Removing Vim with apt

Snap:

sudo snap remove vim-editor
Removing Vim with Snap

Source build, from the vim folder:

sudo make uninstall
Uninstalling the source build

FAQ

Which package is best for programming? vim-nox, because it supports Python, Perl and Ruby.

How do I exit Vim? Press Esc, then type :q! and press Enter to leave without saving.

Quick recap

  • sudo apt install vim is the easiest way.
  • Use vim-nox for scripting features.