Saturday, October 13, 2012

A development setup using MacVim+zsh+tmux

I was initially inspired to seriously update my devel environment by Dr Bunsen's Text Triumvirate article. In the process I discovered some great configurations for development on my MacBook Air + Thunderbolt Display setup.

I really like YADR (Yet Another Dotfile Repo).  It also has some highly opinionated setups for MacVim, zsh and tmux. My main complaint with it is that I really prefer vundle to pathogen for handling Vim plugins. I forked yadr with the intention of replacing pathogen with vundle.

But yesterday I discovered The Ultimate Vim Distribution. It's not the "Ultimate" (which actually means "the last") but it uses vundle instead of pathogen and after looking a bit more carefully at yadr I realised I can use the spf13 Vim plugins without upsetting yadr. I simply had to make ~/.vim and ~/.vimrc point to the .spf13 versions, instead of the .yadr versions.

So I spent most of yesterday merging the .vimrc file from yadr with the one from spf13.

Yadr's developer had the quite brilliant insight to put most of the Vim configuration code (key mappings, config variables etc.) usually kept in .vimrc into separate files in .vim/plugin/settings because anything in .vim/plugin is automatically loaded by Vim at startup. This allowed me to reduce .vimrc from 524 sloc to 288 sloc while adding an additional 55 Bundles to the original 50.

On the other hand, spf13 has an excellent line folding scheme which I've incorporated into the keymap settings file.

Both yadr and spf13 have a preference for Ruby programming whereas I prefer Perl so I removed a lot of Ruby/Rails packages and added a couple of Perl-centric ones.

There were quite a few questionable key mappings in spf13 which I removed and/or changed. Spf13 had <C-L> to move to the right window, an extra keypress for no reason. Yadr has <C-l> and I'm using it (same for h, j and k). Spf13 stole <C-e> to open NERDTree! One of my most used keystrokes! No way. I much prefer yadr's <D-N> (Cmd-N) for the much less used NERDTree. I also disabled the changes to H and L. My muscle memory has them firmly ingrained. spf13 has some useful shortcuts for the fugitive commands (,gs => :Gstatus etc.) but omits the main one I use ,gw (=> :Gwrite). Very strange.

Of course, I wasn't happy with Yadr's tmux config either, so I proceeded to change the link to .tmux.conf from the .yadr version to my own customised version. And Yadr's zsh config only required a few additions/changes to aliases.zsh to get all the shortcuts I've been using for years now. I've not used zsh prior to using Yadr so it has been a slight learning curve from my years of bash use.

So now I have the Text Triumvirate + Ultimate Vim + YADR + My Customisations development config. Simple :)

No comments: