Running your ruby script inside vim
When I was using sublime text it was really easy when just doing some small scripts and make it run inside your editor. I use `cmd+r` before to run my script inside sublime text. I now switch to vim and I was looking for that same shortcut, it was not a daunting task since vim is very customizable.
Put this snippet inside your .vimrc
:map <leader>r :!ruby %<cr>
Be sure to know what is your leader key, for me it’s spacebar, so it’s just spacebar + r and it will run in your buffer. Below is a screenshot of how it looks, you can go back to vim right away after running.
