• +43 660 1453541
  • contact@germaniumhq.com

Moving to Vundle From Pathogen in Vim


Moving to Vundle From Pathogen in Vim

Since 2014 I was using Pathogen to manage my Vim plugins. This Tuesday (19th of March, 2019), after a lot of deliberation I finally moved to Vundle. I couldn’t be happier.

The difference is how they work. On one hand Pathogen requires you to have your plugins available already in your ~/.vim/bundle folder. How? That’s your problem. The solution that I’ve used when using Pathogen is to have git submodules. This comes with three drawbacks:

  1. Cloning must be done with the --recursive flag to pull all the submodules. Otherwise, you need to do git submodule init and git submodule update.

  2. Updating plugins becomes a nightmare. You need to play with the git submodule init/update, git pull, then update on each instance where you have it installed.

  3. If plugins write in their folder (like wordy, that downloads its words indexes) it will end up in modified submodules, that you can’t really commit either.

If you want to add a new plugin, you’d need to go to the ~/.vim/bundle and:

git submodule add https://github.com/some/random/module

Welcome Vundle. In Vundle you describe your plugins directly in the .vimrc. This means no more git submodules. No more changed submodules, or submodules update nightmares.

To install the plugins, all you need is to do run :PluginInstall, the new command that Vundle gives you. :PluginInstall will do the check if the plugin is already installed and install it if needed, using a basic git clone.

At the end the whole configuration becomes something like this:

set nocp
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" vundle plugins
" You need to install them first:
" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Plugin 'VundleVim/Vundle.vim'

" core init:
Plugin 'file://.vim/bundle/AAAciplogic'

" Cool feature plugins
Plugin 'vim-scripts/guicolorscheme.vim'  " 256 color support
Plugin 'bling/vim-airline'               " cooler status bar
" ...
Plugin 'bmustiata/vim-todo'              " TODO lists created with ease

" Navigation
Plugin 'scrooloose/nerdtree'             " NERDTree, basic navigation
Plugin 'ctrlpvim/ctrlp.vim'              " Fuzzy navigate buffers, and files
Plugin 'dkprice/vim-easygrep'            " Grep across multiple files <leader>vv
Plugin 'yegappan/greplace'               " Replace across multiple files

" languages support
Plugin 'posva/vim-vue'
" ...
Plugin 'mustache/vim-mustache-handlebars.git'
Plugin 'bmustiata/vim-cucumber'

" core final init
Plugin 'file://.vim/bundle/zzzciplogic'

call vundle#end()
filetype plugin indent on

In the end I have now a configuration file that’s documentable and maintainable, that lets me have an overview over all my installed plugins - since this is basic vim script, I can simply add comments on why I need that plugin, and what it provides for my daily life. In this migration I’ve noticed plugins that I never used (i.e. emmet), so I just uninstalled them. Looking into the ~/.vim/bundle was of no help whatsoever, to see a big list of folders.

In the mixture of environments I use at work (cygwin, gvim for windows, and an ubuntu virtual machine), this proved invaluable and much easier to update, and synchronize across the board.

Vundle really proved to be a game changes in updating.

Enjoy Vundle.