Wednesday, January 23, 2013

Pathogen, the Vim plugins manager

Pathogen
After installing a few plugins I started to get a little bit annoyed by copying the plugin files to the .vim folder after downloading. It's not a big problem though, but after some plugins, it starts to get messy. You can't see directly what plugins you've installed or what could cause problems and so on...

So to manage the plugins in a proper way, I use Pathogen to do the job. What you have to do is download the plugin from:
https://github.com/tpope/vim-pathogen

Copy the 'autoload' folder to your .vim folder. Actually, the first time you use Vim you should  install pathogen. Create another folder in .vim and call it 'bundle'. The bundle folder is where  you put all your future Vim plugins:
/.vim
   |___ autoload/
   |___ bundle/
              |___  snipmate/
              |___  taglist/
              |___  .../

So every time you download a plugin, you just copy the complete plugin folder in .vim/bundle/
You could also go in the .vim/bundle/ folder and download a plugin using Git, like this:
Assuming you're in the .vim/bundle/ folder.
# git clone https://link.to.vimplugin.git

You just need a small piece of script added in your .vimrc:
execute pathogen#infect()
syntax on
filetype plugin indent on

That's it! Try this out with snipmate plugin, as this plugin doesn't need any other configuration in your .vimrc file. If it works for you, than you can download all your favorite plugins and all are hierarchically structured.

No comments:

Post a Comment

NSNotification example