Managing Vim plugins and scripts
Bundle Up

If you use Vim, you'll likely need a tool to manage its hundreds of plugins. Vundle can help.
Vim started as a text editor, but it long ago evolved into an ecosystem of plugins that number in the hundreds. These plugins, in turn, have created the demand for easy ways to manage them. Vundle (Vim Bundles) [1] is one of the most popular managers. The tool works with the GitHub [2] and Vim script [3] sites and uses a combination of editing the vim configuration file .vimrc
and running four basic commands within Vim. Vundle bills itself – with only minor exaggeration – as "the Vim package manager."
Vim needs a package manager because plugins are not always easy to manage. The subdirectories to install to are not consistent, and you can only update and delete plugins manually from outside Vim.
Vundle is an enhancement of Pathogen [4], a plugin manager that improves on Vim's default file structure by placing all the files for each plugin in a subdirectory of ~/.vim/bundle
, instead of dumping all the help files in ~/.vim/doc
and all the plugins in ~/.vim/plugins
. This change makes locating the help and the script for each plugin much easier than in default Vim structure. Vundle uses Pathogen's directory structure, while adding automatic updates as well as management utilities that work within Vim.
Because Pathogen and Vundle both use the bundle
directory, they use the word "bundle" interchangeably for "plugin or script" – a usage similar to software managers using "packages" to refer to both the applications and the scripts needed to install it.
Setting Up Vundle
If Vim is already installed on your system, delete the .vim
and .vimrc
files in your home directory, or at the very least rename them. Creating new, empty versions of these files will make installation far easier.
The easiest way to obtain Vundle is to use Git [5] to clone the Vundle repository from GitHub on your local machine. Git is used in so many different free software projects that most major distributions carry it. Thus, you can easily install it if you have not done so already. Then, clone the Vundle software repository in your home directory with the command:
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
The next step is to prepare – and, if necessary, create – .vimrc
for using Vundle. The quickest and most error-proof way to prepare .vimrc
is to copy and paste the sample file in ~/.vim/bundle/vundle/README.md
, which is one of the files and directories added when you cloned the Git repository.
However, you might not want all of the plugins or repositories listed in the sample. If nothing else, some of the paths in the sample may be obsolete and will only produce error messages when you try to update them. Although you could always remove unwanted or obsolete entries later, if you learn from the sample, you can configure .vimrc
more to your liking.
The section for Vundle in the .vimrc
configuration file must begin with the commands for calling Vundle:
set nocompatible filetype off set rtp+=/.vim/bundle/vundle
These lines are followed by the last two directories on the path on GitHub to each script that you have downloaded. You must manually add them to .vimrc
, but make sure that Vundle is always the first entry, so that Vundle treats itself as another bundle:
Bundle 'gmarik/vundle'
The other plugins are entered below, one per line, each with the last two directories in its GitHub path enclosed in single quotation marks. You might need to look up a repository's web page, either on the web or from within Vim using one of Vundle's utilities.
The sample .vimrc
uses comments to organize the listing of plugins into original repositories on GitHub, vim-script repos, and local Git repos. You might follow this same structure, although many users may be satisfied with only GitHub repositories. Although GitHub may not include repositories for every Vim plugin ever published, it does include all the best-known ones.
The last line needed in .vimrc
to run Vundle is:
filetype plugin indent on
Below that, the sample includes a summary of Vundle's commands. As you can tell from the fact that its lines are commented out, this section of the sample is for convenience only; from within Vim, you can always enter the command :h vundle
(Figure 1).
Once .vimrc
is organized the way you want it, start Vim, checking for error messages that might be caused by typos in .vimrc
. Then, run :BundleInstall
to configure Vundle to monitor itself to keep the plugin current, as well as any other plugins you might have added (see below).
Installing and Updating Plugins
To install additional plugins, clone their GitHub repositories, just as you did with Vundle. Alternatively, you can download and extract plugins so that they conform to the structure of the subdirectories below ~/.vim/bundle
– one subdirectory per plugin, with /doc
for the help file and /plugin
for the executable.
Either way, open .vimrc
and add the plugin's repository any place below the bundle entry for Vundle itself. Save .vimrc
and, from within Vim itself, run :BundleInstall
(Figure 2).

When the command is followed by the name of a plugin (e.g., :Bundleinstall abolish.vim
), the command installs and activates the command. When run with an exclamation mark at the end (e.g., :BundleInstall!
), the command updates all configured plugins.
In both cases, the command opens a new window, in which the entry currently being updated is indicated by a highlighted first letter and an arrow in the margin. When the updates are complete, a message appears at the bottom of the buffer. You can then press l
(lowercase el) to view the log for the command, jumping to highlighted commands to read any error messages (Figure 3). As with any buffer, the command :q
closes it.
The :BundleInstall
utility runs automatically when you start Vim. However, you can also use it after you have added a new plugin or script in order to update Vim without logging out and back in again.
Listing Configured Plugins
To see which plugins are installed in Vim using Vundle, just look at the names of the subdirectories below ~/.vim/bundle
.
However, Vundle makes viewing configured plugins even easier with :BundleList
(Figure 4). This command opens a window listing the plugins that are configured on the current installation of Vim. Note that a plugin may be configured and working in Vim, but not activated – that is, not listed in .vimrc
to receive automatic updates.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
News
-
An All-Snap Version of Ubuntu is In The Works
Along with the standard deb version of the open-source operating system, Canonical will release an-all snap version.
-
Mageia 9 Beta 2 Ready for Testing
The latest beta of the popular Mageia distribution now includes the latest kernel and plenty of updated applications.
-
KDE Plasma 6 Looks to Bring Basic HDR Support
The KWin piece of KDE Plasma now has HDR support and color management geared for the 6.0 release.
-
Bodhi Linux 7.0 Beta Ready for Testing
The latest iteration of the Bohdi Linux distribution is now available for those who want to experience what's in store and for testing purposes.
-
Changes Coming to Ubuntu PPA Usage
The way you manage Personal Package Archives will be changing with the release of Ubuntu 23.10.
-
AlmaLinux 9.2 Now Available for Download
AlmaLinux has been released and provides a free alternative to upstream Red Hat Enterprise Linux.
-
An Immutable Version of Fedora Is Under Consideration
For anyone who's a fan of using immutable versions of Linux, the Fedora team is currently considering adding a new spin called Fedora Onyx.
-
New Release of Br OS Includes ChatGPT Integration
Br OS 23.04 is now available and is geared specifically toward web content creation.
-
Command-Line Only Peropesis 2.1 Available Now
The latest iteration of Peropesis has been released with plenty of updates and introduces new software development tools.
-
TUXEDO Computers Announces InfinityBook Pro 14
With the new generation of their popular InfinityBook Pro 14, TUXEDO upgrades its ultra-mobile, powerful business laptop with some impressive specs.