Learn through the super-clean Baeldung Pro experience:
>> Membership and Baeldung Pro.
No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.
Last updated: June 1, 2024
Vim is a popular text editor among users of Unix-like operating systems such as Linux. It’s an improved version of the old vi editor, and it comes with features that can help write code, manage files, and more.
In this tutorial, we’ll walk through the different Vim packages available on Linux. We’ll look at what makes each one unique, what they’re typically used for, and more.
We tested the instructions in this tutorial on Ubuntu 22.04 LTS (Jammy Jellyfish) and its native apt package manager.
Vim isn’t a one-size-fits-all editor. Hence, Linux distributions offer a variety of packages, each with its strengths and weaknesses to suit different needs.
In addition, we can find simple and lightweight packages that are perfect for quick edits, especially on older machines.
There are also feature-rich ones that include a graphical user interface (GUI) and support various scripting languages.
As a result, this variety enables us to find the perfect Vim that aligns with our workflow and preferences.
Now that we’ve covered the basics of Vim packages, let’s go deeper into the various variants available on Linux systems.
Notably, each variant brings its unique flavor to the table and caters to different preferences and use cases. By understanding their strengths and weaknesses, we’re better equipped to pick the ideal editor for the current tasks and challenges.
This is the standard Vim package and is present on many Linux systems. It offers a comprehensive set of features for everyday text editing.
The package is a great choice for those comfortable working in the terminal and don’t fancy graphical elements or advanced scripting capabilities:
Now, let’s install the package:
$ sudo apt install vim
Notably, vim doesn’t come with built-in support for scripting languages like Python or Ruby. However, we can easily extend the editor functionality using plugins. That’s to say, we can add features like syntax highlighting, code completion, and more.
If we’re working with an older machine or prefer a lightweight editing tool, vim-tiny is a suitable choice. The highlight of this Vim variant is its speed and minimalism.
Furthermore, it’s the default editor on Ubuntu and is stripped down to the essentials. Therefore, this feature makes it incredibly fast and resource-friendly:
To give this package a try, let’s install it with a simple command:
$ sudo apt install vim-tiny
Still, vim-tiny doesn’t support Perl, Ruby, Python, or TCL scripting. It also lacks fancy features like multi-level undo.
vim-nox is designed for those who prefer to work in the terminal without the distraction of a graphical interface. The package also offers the power of scripting languages like Perl, Python, Ruby, and TCL.
Above all, its scripting capabilities enable us to create powerful macros, build custom plugins, and streamline the overall editing experience:
Now, let’s install vim-nox:
$ sudo apt install vim-nox
In addition, vim-nox lacks clipboard support. However, its ability to leverage scripting languages more than compensates for this minor inconvenience.
If a graphical interface is preferred, vim-athena is a good fit. Unlike the other graphical Vim packages that use the GTK toolkit, this one uses the Athena toolkit. Consequently, this difference gives it a distinct appearance.
In addition, with its lightweight GUI, vim-athena offers a visual editing experience without sacrificing the core functionalities of Vim:
So, let’s see how to install vim-athena:
$ sudo apt install vim-athena
This package is a great choice if we want to use a graphical Vim with a unique interface that also supports scripting.
vim-gtk could be for users who are fans of graphical user interfaces and prefer a desktop environment like GNOME built on the GTK toolkit. This package takes the power of the main editor and wraps it in a familiar GUI, so we get the best of both worlds.
With vim-gtk, we have all the usual Vim features at our fingertips. On top of that, we also have the added convenience of menus, toolbars, and mouse support:
To install vim-gtk, we again use apt:
$ sudo apt install vim-gtk
In addition, we can use vim-gtk to automate tasks and customize workflow. Thus, it’s used to build plugins using scripting languages like Perl, Ruby, TCL, and Python.
For Linux users who are into graphical interfaces and use the GNOME desktop environment, vim-gtk3 is a natural fit. This package is built with the GTK3 toolkit, the foundation of GNOME’s visual style.
As a result, it blends well with the GNOME desktop, giving us a consistent look and feel.
Like other GUI-based Vim packages, vim-gtk3 gives us the best of both worlds – the power and flexibility of the main editor mixed with familiar features like menus, toolbars, and mouse support:
Let’s install vim-gtk3:
$ sudo apt-get install vim-gtk3
In addition, it’s used to automate tasks, create custom plugins, and take full advantage of the Vim scripting capabilities.
With plugins, we can add new features, customize workflow, and turn Vim into the perfect text editor.
Let’s now look at some essential plugins that can take the editing experience to the next level.
To make the most out of Vim, we use plugins. These handy add-ons provide extra features and make life easier. Yet, with so many plugins out there, things can get a bit messy. So, that’s where plugin managers come in.
Moreover, plugin managers help us install, update, and remove plugins without having to fiddle with files manually. This keeps the editor setup neater. In addition, it makes it effortless to try out new plugins whenever we want.
Now, let’s briefly explore some of the most popular plugin managers for Vim:
Most importantly, using any of these tools makes it straightforward to add new features to the current setup.
Code completion plugins are pretty handy when writing code in Vim. They act like assistants, suggesting what we might be attempting to type. This can save a lot of time and effort.
Let’s take a quick peek at some of these plugins that can boost coding efficiency:
In short, with any of these plugins, we get context-aware suggestions and see what parameters a function takes.
File explorer plugins enable us to browse a project’s structure, open files in a few strokes, and even do basic things like creating, deleting, or renaming files, all without leaving Vim.
Now, let’s learn about a few file explorer plugins that can help us stay organized:
These file explorers make it easy to move between project files. Consequently, they improve workflow and make using Vim an interesting experience.
Syntax highlighting and linting are like superpowers for code editors. They make code more readable and help us spot errors before they become problems.
Let’s take a look at some plugins that offer these features:
In conclusion, with these plugins, we can keep code clean, well-organized, and error-free. Hence, it’s like having a personal code assistant built right into the editor.
For those who use Git for version control, there are Vim plugins that can make life much better. Such plugins bring Git right into the editing environment.
This makes it easier to perform common Git operations like committing changes, viewing diffs, and managing branches without exiting the editor.
Now, let’s explore some Git integration plugins for Vim:
Therefore, with these plugins, we can easily manage Git projects without switching back and forth between editor and terminal.
Most importantly, it’s a real time-saver and can help us stay focused on the project at hand.
In this article, we took a quick tour of the Vim packages available on Linux with apt. Each of these packages comes with their unique features and strengths.
Therefore, whether we prefer a minimalist command-line experience or a full-featured GUI, there’s a package that can meet the current requirements.