Last Updated: February 25, 2016
·
279
· leuchtetgruen

Save and run a ruby file in VIM using F5 as shortcut

Put this

autocmd FileType ruby nmap <F5> <ESC>:w<cr> :!ruby %<cr>

in your vimrc

The principle applies to most other programming languages as well, maybe with the intermediate step of compiling.