15 Dec 2012

rcodetools and VIM

I’ve been listening to RubyRogues which introduced me to Avdi Grimm from the Ruby community. I’ve also been subscribed to his RubyTapas screencast series which is a 2x a week Ruby show.

He uses a neat tool called rcodetools to execute Ruby code from within an Emacs buffer. Unfortunately, it wasn’t working when I tried to use the VIM counterpart, with segfault codes showing up. Here’s the fix: ( I’m using RVM to manage my Ruby Versions ) *Install Tim Pope’s excellent rvm extension for VIM cd ~/.vim/bundle git clone git://github.com/tpope/vim-rvm.git

*Install rcodetools using RVM gem install rcodetools

*Remove keybindings in other programs (ie Dashboard & Expose) for F10, F11, F12 or rebind the keys per README.vim

Now enter a VIM file and type F12 on any lines that you want the output from followed by F11 to evaluate the whole file. If you want to only re-evaluate the current line use F10 instead of F11.

It’s a great tool for terminal screencasting! Thanks Avdi for letting me know that this tool is available.