« Previous 1 2
Managing Vim plugins
Plug and Play
NeoBundle
Just as Vundle builds on Pathogen, so NeoBundle builds on Vundle. In the past, NeoBundle was difficult to use, because it was in rapid-development and detailed instructions were only in Japanese. More recently, however, development has slowed to maintenance only, and English instructions are available.
NeoBundle [7] has all the features of Vundle, although with different names for its utilities. Additionally, it has several advantages. To start with, it supports Subversion or Mercurial repositories, while Vundle supports only Git. Moreover, it can be locked so that it only uses a specific version of Vim, which can be used to avoid having updates break your collection of Vim plugins.
Most importantly, NeoBundle integrates with other extensions written by its creator Shougo Matsushita. Advanced users might be especially interested in this feature because of Unite.vim [8], a plugin for searching files, yanking (copying and pasting), and manipulating buffers. If such features interest you, then you might prefer NeoBundle over Pathogen or Vundle.
NeoBundle requires Vim 7.2.051 or higher. Integration into other plugins may require or recommend other dependencies – for example, vimproc for use with Unite.vim. To install on either Linux or Windows, run the commands:
mkdir ~/.vim/bundle git clone https://github.com/ Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
You can copy the sample .vimrc
file from NeoBundle's GitHub page. However, if you do not want the five plugins it mentions, instead you can add the lines shown in Listing 1 to .vimrc
instead. These lines assume you are using GitHub. To use another site, add its full URL.
Listing 1
Modifying .vimrc
01 if has('vim_starting') 02 set nocompatible 03 set runtimepath+=~/.vim/bundle/neobundle.vim/ 04 endif 05 06 call neobundle#begin(expand('~/.vim/bundle/')) 07 08 NeoBundleFetch 'Shougo/neobundle.vim' 09 10 call neobundle#end() 11 12 filetype plugin indent on
To install other plugins from GitHub, use the following command structure:
curl -k https://github.com/[MAINTAINER]/[PLUGIN PATH] > ~/.vim/bundle/[PLUGIN PATH]
When you install the first plugin, check that it adds a line for it below the line NeoBundleFetch 'Shougo/neobundle.vim'
. For example:
NeoBundle 'Shougo/vimshell'
or, if you want to pin NeoBundle to a specific version number:
NeoBundle 'Shougo/vimshell', { 'rev' : 'REVISION-NUMBER' }
NeoBundle's utilities are:
- NeoBundleUpdate, NeoBundleInstall!: Both install or update plugins. By itself, it updates all installed plugins, but you can also specify a plugin as well as a revision number.
- NeoBundle {REPOSITORY URI} [[REVISION}] [,OPTIONS}]]: Configures a plugin. If a revision is specified, then the plugin is never updated.
- NeoBundleList: Lists extensions.
- NeoBundleClean: Removes unused plugins and runs an interactive utility for removing unused extensions.
These utilities are available in slightly different forms when Neobundle and Unite.vim are run together. For more information, run the command :help neobundle
from within Vim.
Deciding How to Manage
Which of these plugin managers you should use depends on your needs and preferences.
On the one hand, Vim-addon-manager simplifies maintenance by integrating Vim updates with standard package management and requires no manual editing to set up. On the other hand, it does not update automatically or include the utilities offered by Vundle and NeoBundle.
Similarly, although the updates offered by Vundle and NeoBundle are convenient, for security's sake, you may not want automatic updates. If you are dealing with plugins still being rapidly developed, you may prefer NeoBundle over Vundle, because it can pin each plugin to a particular version. Neobundle could also be preferable if you are using a non-Git repository.
Still, between the four plugin managers, you should be able to find at least one that suits you. The truth is, if you use more than a couple of plugins, any of them should be better than Vim's default handling of plugins.
Infos
- Vim: http://www.vim.org/
- LinuxQuestions Reader Choice Awards: http://www.linuxquestions.org/questions/2016-linuxquestions-org-members-choice-awards-123/text-editor-of-the-year-4175596307/
- VimAwesome: http://vimawesome.com/
- Vim-addon-manager: https://packages.debian.org/jessie/vim-addon-manager
- Pathogen: https://github.com/tpope/vim-pathogen
- Vundle: https://github.com/gmarik/vundle
- Neobundle: https://github.com/Shougo/neobundle.vim
- Unite.vim: https://bling.github.io/blog/2013/06/02/unite-dot-vim-the-plugin-you-didnt-know-you-need/
« Previous 1 2
Buy this article as PDF
(incl. VAT)