As you may know I write a lot of Ruby in Vim. One thing I love about the editor is the ability to run my Ruby classes with leaving the editor. This can be accomplished by running the following command.

:!ruby % 

Switching this to a leader makes it even faster, so my command is “\r”. To set a leader drop this in your ~/.vimrc

map r :!ruby %


Leave a Reply

Your email address will not be published. Required fields are marked *