Managing Vim plugins

NeoBundle

Just as Vundle is based on Pathogen, so NeoBundle is based on Vundle. The chief rationale for NeoBundle is that Vundle's creator preferred to keep Vundle simple, whereas NeoBundle's creator chose to add additional functionality. For example, like Vundle, NeoBundle works with Git, but it also supports Subversion or Mercurial repositories. Additionally, NeoBundle lets you lock a plugin to a specified update, which prevents updates that might break the plugin.

More idiosyncratically, NeoBundle can be integrated with other plugins written by the same developer, such as Unite.vim [6], a file and buffer manager, and vimshell.vim [7], a scripting shell that works with vimproc.vim [8], which is an asynchronous execution library. However, most users will probably be interested primarily in NeoBundle itself.

NeoBundle shares the directory structure of Pathogen and Vundle and can be installed with a similar command (Figure 3):

curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh

NeoBundle also requires modifications to .vimrc similar to those that Vundle requires, aside from the names. A minimum .vimrc for NeoBundle is shown in Listing 3.

Figure 3: Installing NeoBundle with curl.

Listing 3

Minimum .vimrc for NeoBundle

 

Other plugins should be added, one per line, beneath the line:

NeoBundleFetch 'Shougo/neobundle.vim'

As with Vundle, the syntax assumes that files on GitHub and any other repository must be specified using its complete URL. Other plugins are installed in the same way as NeoBundle.

Similarly, most of NeoBundle's utilities for use within Vim differ from Vundle's mainly by name, with small variations in functionality: :NeoBundleInstall and :NeoBundleUPdate to enable or update, :NeoBundleList to view unenabled extensions, and :NeoBundleClean for removing unused extensions (see above). Additionally,

:NeoBundle {REPOSITORY URI} [VERSION}] [OPTIONS}]

enables an extension while locking it into a specified version to prevent unwanted updates (Figure 4).

Figure 4: Like Vundle, NeoBundle automatically updates plugins as Vim starts.

For most users, the main advantages of NeoBundle are the types of repositories it supports and the ability to lock plugin versions. Because the creator is Japanese, English-speaking users might have to wait for documentation; nonetheless, there is no doubt that NeoBundle is a major addition to Vim plugin management.

Choosing a Plugin Manager

The four plugin managers I discussed here give Vim users no shortage of choices. However, which you choose can be highly subjective.

Vim-addons is ideal for those familiar with Debian or one of its derivatives, as well as those comfortable with package management from the command line. It also has the advantage of requiring less manual configuration, or the memorization of utility names, as well as being able to manage plugins for both the current user and the entire system.

Of the other three, NeoBundle might appear at first to be the obvious choice, because it elaborates upon Vundle and Pathogen. NeoBundle's ability to lock versions is definitely an advantage over Vundle, but some users may prefer Pathogen, opting for the sake of security for manual updates rather than depending on remembering to set version preferences. Similarly, those concerned about NeoBundle's rapid and wide-ranging development might opt for the relative simplicity of Vundle, especially if they have no interest in integrating with other plugins.

However, whichever plugin manager you choose, you cannot go far wrong as long as you take the time to understand it. If nothing else, each is a considerable improvement over trying to manage dozens of plugins in unmodified Vim.

The Author

Bruce Byfield is a computer journalist and a freelance writer and editor specializing in free and open source software. In addition to his writing projects, he also teaches live and e-learning courses. In his spare time, Bruce writes about Northwest coast art. You can read more of his work at http://brucebyfield.wordpress.com

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Vim Housekeeping

    A plugin manager can help you corral your growing collection of Vim plugins. Choosing one depends on your personal preferences.

  • Command Line: Vundle

    If you use Vim, you'll likely need a tool to manage its hundreds of plugins. Vundle can help.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News