Managing your vim plugins with bundle – Vundle


Vundle – Vim Bundle

Motivation

Vim is a powerful and famous editor, especially on *nix platform. You can always find the vim on these platform. But same as other editors, the power comes from its extensibility and plugins contributed by community.

The most difference between Vim and Emacs is vim user have same key seq for same action, while Emacs depends on key bindings to provide the same key ( or we can say thought/consciousness) for similar but different scenarios. One thing is true for both of them: the power is from plugin.

In standard layout of vim installation, the built-in plugins is located in /usr/share/vim/vim72. Some plugins have just one file, which is easy for install/remove, while some plugins have multiple files(syntax file, compiler, indent, autoload, etc). This is not a problem for built-in plugins because they are installed along with vim by OS package system, but sometimes you will download some scripts from official vim scripts website  or somewhere else directly and install them into folder ~/.vim . Still put all plugins with flat layout, that’s horrible!

Pathogen

So we need  a tool to manage these plugins. Vundle is designed to address this issue. Actually Vundle is inspired by Pathogen and Bundle (Ruby gems manager), you know the word “inspired”, generally which means the later one has better solution or additional features.

With Pathogen, We can keep all of plugins self-contained in single directory so that they can be easy to  be maintained and updated.

Using git submodule,  you can sync and update the plugins hosted on github or other git based version control service. Of course, you can use other VCS tool to get the source code.

Refer these blog posts manage vim and vundle-vs-pathogen to get a glance about Pathogen way. Even you don’t know Chinese, you can guess what’s the major feature of pathogen by observing the directory tree.

Homepage of Pathogen, you can find instructions here. Actually I was confused by the term ‘runtimepath’ when read the README in first time.

Vundle = Pathogen + Git + Vim-Scripts.org

With Vundle, the downloading from git repository had been integrated.

We declare the bundles ( plugins) in .vimrc, and use BundleInstall command to install the bundles, BundleInstall! to update the bundles. Note: append ! (bang) for command ‘update’.  Simpler than pathogen, right?!

 " original repos on github
 Bundle 'tpope/vim-fugitive'
 Bundle 'Lokaltog/vim-easymotion'
 Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
 Bundle 'tpope/vim-rails.git'
 " vim-scripts repos
 Bundle 'L9'
 Bundle 'FuzzyFinder'
 " non github repos
 Bundle 'git://git.wincent.com/command-t.git'

Reference:

You can find more links about vim management tools in http://vim-scripts.org/vim/tools.html . Vim.org + Vimballs + GetLatestVimScripts and vim addon manager can be deprecated since we have Vundle now.

vim-scripts.org provide a mirror of all scripts on vim.org using git. The founder of this site wrote a ruby application vim-scraper to scrap the scripts from vim.org, and assemble them into github. A central repository of vim scripts is very import factor for Vundle’s win.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s