Choosing a Vim Plugin Manager
Command Line – Vim Plugin Managers
![© Lead Image © Danila Krylov, 123RF.com © Lead Image © Danila Krylov, 123RF.com](/var/linux_magazin/storage/images/issues/2020/230/command-line-vim-plugin-managers/po-21487-123rf-danila_krylov_123rf-polieren_resized.png/760050-1-eng-US/PO-21487-123RF-Danila_Krylov_123RF-Polieren_resized.png_medium.png)
© Lead Image © Danila Krylov, 123RF.com
A plugin manager can help you corral your growing collection of Vim plugins. Choosing one depends on your personal preferences.
New users of the Vim text editor may be content to use it as installed from their distribution's repositories. However, Vim has hundreds of plugins, and installing one often leads to adding more out of curiosity. However, multiple plugins can quickly become a management nightmare, because unadorned Vim dumps plugins into one directory, which makes file management difficult.
As a result, a variety of Vim plugin managers have been released over the years. Several begin by installing each plugin to a separate directory to simplify file management. Most involve creating and editing a ~.vimrc
file in your home directory. Some are plugins themselves, while a few operate at least partly outside of Vim's structure. Many are housed on GitHub, with instructions specialized for that site.
Listed here are some of the most common Vim plugins that run from the command line. Each makes its own assumptions about its users' knowledge or preferences. Only basic instructions are given, but most of the managers are well-documented online.
Pathogen
Pathogen [1] is the oldest manager that runs from within Vim. Like many that were created after it, Pathogen rearranges the Vim directory structure, providing a separate directory for the files for each plugin, an innovation that makes installation, upgrading, and deletion more efficient (Figure 1). However, unlike some other managers, Pathogen does not automatically upgrade or delete plugins.
![](/var/linux_magazin/storage/images/issues/2020/230/command-line-vim-plugin-managers/figure-1/760053-1-eng-US/Figure-1_large.png)
To install Pathogen, enter the following at the command line:
mkdir -p ~/.vim/autoload ~/.vim/bundle && curl LSso~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Users will also need to add lines to their .vimrc
file to start Pathogen before any other plugin, so that it can manage the rest:
execute pathogen#infect() syntax on filetype plugin indent on
These lines are the minimum required to use Pathogen, but you may also enable automatic updates by adding the lines:
call pathogen#runtime_append_all_bundles() call pathogen#helptags() "
Note, though, that this option can significantly extend Vim's startup time if you have a lot of plugins.
Other plugins can be added from GitHub, by running from within ~/.vim/bundle
the command:
git clone git://github.com/[WRITER]/ [PLUGIN PATH] ~/.vim/bundle/[PLUGIN PATH]
GitHub is a useful source, because many Vim plugins are housed there.
Despite Pathogen's age, many users continue to favor Pathogen for its simplicity and order. Since updates can sometimes go wrong, some also appreciate being able to avoid automatic updates.
If you are managing multiple remote plugins, have a look at vim-pandemic [2], which is designed to work alongside Pathogen.
Vundle
Vundle [3] is an enhancement of Pathogen. Originally, Vundle referred to plugins as "bundles," making its name an abbreviation for "Vim bundles." To Pathogen's rationalized directory structure, Vundle adds several utilities (Figure 2).
On Windows, Vundle has a graphical interface. To install Vundle on Linux, run:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
In other words, Vundle is installed to a subdirectory of .vim/bundle
, just like any other plugin.
To update plugins automatically with Vundle, add to the following lines to .vimrc
:
set nocompatible filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim'
These lines set the run-time path to Vundle, initiate it, and set Vundle to manage itself. Below the last line, add the other plugins that Vundle manages, one per line, each starting with Plugin
. For example:
Plugin 'tpope/vim-fugitive'
The GitHub Vundle page gives examples of how to list other sources that you might use.
Installing Vundle also installs four utilities:
:PluginList
, which lists configured plugins:PluginInstall
, which installs or updates plugins:PluginSearch
, which searches for a plugin:PluginClean
, which removes plugins with a confirmation message
The last three are completed with the name of a plugin.
Vundle is an intermediate Vim manager, kept simple by having utilities that are run manually. It is a solid choice for constant Vim users who are always tinkering with their Vim installations, adding and updating their plugins.
Dein.vim and NeoBundle
A few years ago, a Vundle modification was released called NeoBundle [4]. NeoBundle's creator, Shougo Matsushita, went on to write dein.vim [5] to replace NeoBundle. Much like NeoBundle when first released, dein.vim has minimal English documentation. The documentation that is available assumes a strong knowledge of Vim and the use of plugins.
Like NeoBundle, dein.vim supports the Mercurial and Subversion version control systems, as well as Git. It can be set to use a specific Vim release, a feature that can keep an update from breaking Vim and its plugins. It differs from NeoBundle in that it uses system calls rather than utilities.
In addition, dein.vim itself is optimized for speed – although it is only 100 milliseconds or so faster than NeoBundle. Much of this speed is obtained by concurrent loading, which can make pinpointing a misbehaving plugin difficult at times.
To install dein.vim, enter:
mkdir ~/.vim/bundle curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
Then add the code in Listing 1 to .vimrc
.Install dein.vim
with:
:call dein('PLUGIN-PATH')
Listing 1
Dein.vim Code for .vimrc
if &compatible set nocompatible endif " Add the dein installation directory into runtimepath set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim if dein#load_state('~/.cache/dein') call dein#begin('~/.cache/dein') call dein#add('~/.cache/dein/repos/github.com/Shougo/dein.vim') call dein#add('Shougo/deoplete.nvim') if !has('nvim') call dein#add('roxma/nvim-yarp') call dein#add('roxma/vim-hug-neovim-rpc') endif call dein#end() call dein#save_state() endif filetype plugin indent on syntax enable
Plus add similar lines for other plugins to run at startup. To decrease startup time, other plugins can be set to be "lazy-loaded" – that is, loaded after startup by pressing a designated keystroke (Figure 3).
![](/var/linux_magazin/storage/images/issues/2020/230/command-line-vim-plugin-managers/figure-3/760059-1-eng-US/Figure-3_large.png)
Dein.vim is an advanced manager, ideal for those with a dozen or more plugins, who want to get every last bit of speed from their installation. For those who want a better-documented, advanced plugin-manager, NeoBundle is still available.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.