In a previous post I talked about switching to Vim and how I was using Janus to get a good foundational set of plugins to work with, and make starting with vim less daunting. As I’ve gotten more comfortable with vim, I wanted a simpler way to manage my vim config. I wasn’t using the framework-y bits of Janus, and it included a pile of plugins I’ll simply never use. After hearing great things about pathogen I decided to give it a spin.
Updating to use pathogen
I started off by making a new git repo to hold my config. I’m lazy and want an easy way to keep all my vim installs in sync, and git is great for that. I started off by copying my existing
gvimrc files. To make pathogen work I had to add two lines to my vimrc:
- " Include pathogen
- call pathogen#infect()
- call pathogen#helptags()
This sets up the pathogen magic. Then, I created the directories suggested by pathogen. I went through the very long list of plugins that Janus ships with and picked out the ones I actually use. Of those, many are hosted on github making submodules a perfect fit. For every plugin on github I did something similar to:Show Plain Text
- git submodule add git://github.com/tpope/vim-fugitive.git bundle/fugitive
I use a few plugins that are not hosted on github as well. For these I just added the plugin files directly into my repo following the pathogen conventions.
Making it easy to install
Once all my plugins were wired together, I had a git repo with all the plugins I wanted, and my vimrc files. I wanted to make setting up a new vim install really simple. I wrote a simple make script that allows me to run all the install steps in one command. This makes the whole process take 2 steps, which was acceptable for me:Show Plain Text
- git clone email@example.com:markstory/vim-files.git ~/.vim
- cd .vim && make install
You could substitue fabric or rake for make if you wanted. I prefer make as its almost always results in a smaller script than using anything else. I’ve found pathogen to be a great tool for managing a vim setup. It makes a great next step after you’ve gotten comfortable with using a prebuilt package like Janus. A big thanks to Tim Pope, for making it, and all other other fantastic plugins he’s written. If anyone is interested, I’ve made my setup available on github .