Fixing conflicting Vim plugins with NeoBundle

June 01, 2014

I started messing around with Clojure this weekend and quickly discovered that something in my Vim setup was causing parentheses matching with % to not work quite right. The output in the statusbar showed a call to ruby-matchit, a plugin that lets you jump between between the start and end of blocks and method definitions in Ruby. As wonderful as that is, I certainly don’t need it while editing Clojure.

As it turns out, there’s a fork of the Vundle plugin manager called NeoBundle that supports lazy loading and initialization of plugins. You can do this with the following in your .vimrc:

NeoBundleLazy 'vim-scripts/ruby-matchit'
autocmd FileType ruby NeoBundleSource ruby-matchit

Switching to NeoBundle from Vundle was a breeze, and now vim-matchit only loads when I open Ruby files. Hooray!