Wednesday, November 10, 2010

Trying a new configuration scheme

So the other day I noticed this *amazing* plugin for looking at VIM's undo history. The guy says, if you aren't on pathogen get on it.

Round 1

pathogen is a simple Vim script that lets you put each plugin into one specific folder all on its own. Its own sandbox. I like this idea because as a user of many many plugins, debugging them can be troublesome: which files are related to the plugins, how, is it documented, etc. Its hard when every single plugin is dumped into your ~/.vim folder. Now each plugin is dumped into ~/.vim/bundle/.

I made a new .vim folder, and put pathogen in. Tried sticking in each plugin. What a pain, all this manual folder creation. Very very cumbersome. In fact, in the first round I couldn't get most of my plugins to even work. Everybody was complaining.

I gave up, went back to my old .vim folder.

Round 2

Looked around the internet a little more and found this blog entry at Tammeh Saleh which offered a solution: instead of manually porting all your plugins over, use a script (update_bundles.rb) to setup all of your github and vim.org scripts.

Genius, of course!

Tried the script out. Seemed like it might work out. Folders magically appeared in my ~/.vim/bundle folder. But. A lot of things still didn't work.

Upon investigation I realized that a good deal of the vim.org scripts I use are zipped, or tar.bz2'd or targ.gz, or vba.gz'd up. As wonderful as the ruby script was, it assumed that all vim.org scripts are zipped. Wrong.

I gave up, and stewed.

Round 3

Fine. I'll mod the script. Now I can totally blow away my ~/.vim/bundle folder and run this little ruby script and it completely regenerates regardless of zip/bzip/vimball/etc

Requires some slight manual intervention for vimball installation (it launches vim, runs the vimball install, you just have to :quit out after to get it on its way).

I think I'm happy.

Switching to pathogen also had another slight improvement. Some of my own personal duct tape type plugins got themselves checked into github for the first time. Probably should have done that awhile ago.

If you wanna try this out yourself I suggest you download my script, and read the Tammeh Saleh blog entry.