Vim is a command-line text editor used to write scripts, change configuration files, or work on remote Linux servers through SSH. Vim for Ubuntu is suitable because it integrates naturally with the Linux command-line workflow, works reliably over SSH, and is available on virtually every Linux system.
4 Ways To Install Vim On Ubuntu
Vim’s modal editing system, extensive customization, and close integration with Linux tools make it exceptionally well-suited for Ubuntu in both desktop and server environments. Vim Text editor comes with different versions based on their functionality. Below is the table that gives commands for installing each version:
| Vim Package | Description | Install Command |
|---|---|---|
| vim | The standard full-featured terminal version of Vim. | sudo apt install vim |
| vim-tiny | A compact, stripped-down version of Vim that provides only basic editing features. | sudo apt install vim-tiny |
| vim-nox | A Vim build that includes support for scripting languages like Python, Perl, and Ruby. | sudo apt install vim-nox |
| vim-gtk | A graphical version of Vim built with the GTK2 toolkit.. | sudo apt install vim-gtk |
| vim-gtk3 | A GUI version of Vim using the modern GTK3 toolkit. | sudo apt install vim-gtk3 |
| vim-gnome | A graphical Vim variant integrated with GNOME libraries | sudo apt install vim-gnome |
| vim-athena | A lightweight graphical version of Vim using the Athena widget toolkit. | sudo apt install vim-athena |
1: Through Ubuntu Default App Installer
The Vim text editor is installed by default on Debian-based Linux operating systems, but it is the minimal version, i.e., Vim-tiny, which has limited functionality. To install the complete version of Vim, use the apt package installer by executing the command below:
sudo apt install vim
Verify the Vim text editor installation using the version command as given below:
vim --version
2: Through GitHub
Another way to install Vim on Ubuntu is by downloading its source file from GitHub. To download the source file, use the git clone command as given below:
git clone https://github.com/vim/vim.git
Once the clone is created, move to the src directory under the vim folder:
cd vim
cd src
The make file for Vim is already created, so use the make command to compile the source code:
make
While compiling the source code for the Vim text editor, there might be an error for tgetent() indicating the absence of libraries like ncurses/termcap. The tgetent() is primarily used for functions like cursor movement and colors :

To fix the tgetent()…. Configure:error: Not Found !, execute the following command:
sudo apt install libncurses5-dev libncursesw5-dev
Once the source file is compiled successfully, install Vim on Ubuntu via the Makefile that primarily contains all the installation instructions:
sudo make install
To verify the Vim installation on Ubuntu via is source file navigate to the src directory and execute the version command. To access Vim from anywhere, its symbolic link can also be created:
vim --version
3: Through the Ubuntu Software App
Just like Google Play Store and Apple App Store, Ubuntu comes with a software app from which Vim text editor can be installed. First search for it as in the image below:

Next, to install Vim on Ubuntu, click on Install icon :

4: Through Snap Store
Snap is a self-contained third-party app installer primarily created to solve issues with Linux packaging, like dependency conflicts, and features like auto update and rollback. To install Vim on Ubuntu, execute:
sudo snap install --edge vim-editor
Next, confirm the installation of Vim by listing snap-installed apps on the system by executing the command below:
sudo snap list
5: Through Flathub Repository
Flathub is a universal packaging system for Linux distributions, as it works on every Linux distribution, which solves the issue of compatibility due to different package formats. To install Vim on Ubuntu via Flathub, execute:
flatpak install flathub org.vim.Vim
To launch Vim text editor via Flatpak, execute the command below :
flatpak run org.vim.VimBasic Commands For Vim on Linux
Here are some of the basic commands for getting started with Vim Text Editor:
| Sr No. | Command | Description |
|---|---|---|
| 1 | i | Enter’s Insert Mode to start typing text before the cursor. |
| 2 | a | Enters Insert Mode but starts typing after the cursor. |
| 3 | Esc | Switches from the current mode back to the default mode. |
| 4 | :w | Saves (writes) the current file. |
| 5 | :q | Quits Vim. Fails if unsaved changes exist. |
| 6 | :wq | Saves the file and then quits Vim. |
| 7 | :q! | Quits without saving changes. |
| 8 | dd | Deletes the entire current line. |
| 9 | yy | Copies (yanks) the current line. |
| 10 | p | Pastes text after the cursor or current line. |
| 11 | /text | Searches forward in the file for the word “text”. |
| 12 | u | Revert the previous modification. |
| 13 | gg | Navigate to the file’s start. |
| 14 | G | Navigates to the last section of the file. |
Conclusion
This guide discussed four ways to install Vim Text editor on Ubuntu, which include: using Vim source file, APT package installer, Ubuntu’s software App, Snap, and Flathub store.
