Sunday, December 25, 2011

I hate work (but not working)

And the headline's not even true. I don't hate work; but I hate our IDE.
I just want to use vim, that's all.

I'm late to the party, I'm sure, but if you are unaware, there's a plugin for vim called pathogen.
This thing plays exceedingly well with git; I've been configuring a Mint box for my own devious purposes (purpose: configure a mint box!) and ran into the good ol' problem of "What's the fastest way to configure my environment?"

This is why I use vim - 90% of my configuration is in one .vimrc file I can pass from computer to computer.
The other big chunk that I haven't been able to easily port has been the plugins. I don't use a lot of them but the ones I do use I'd like to use everywhere.

I've approached it in different manners; my last attempt was gitHubbing my plugins folder, but that still requires path management.
I was on the right track, but doing it the wrong way.

Enter Pathogen.
I add a couple of files/subdirectories to my .vim directory, a call to pathogen in my vimrc (call pathogen#infect() ) and now I can install plugins by git cloning into the .vim/bundle directory, and pathogen will do the rest*

So that gets you a little bit; now it's esay to clone into one place and use git as your install tool. Hunky dory. But it doesn't save you that much if it's one machine.
But if you're using a lot of machines, or jump between work and home - look out!
After you clone all the packages you want the first time you run it, you can then grep out the git clone commands:
history | grep 'git clone' >> clonecalls.txt

Now you have a file with all the clone calls.
You're only a hop skip and a jump away from a bash/python script that will run most of it for you, and keep it up to date.

I'll be writing one in the near term and post it to Github and here when it's done.

* running :Helpfiles after installing plugins is necessary as well; you can make pathogen do it in your vimrc but then you're calling it every time you launch vim.

No comments:

Post a Comment