Vim Ruby F5 to Run
Here’s how I got F5 to run the Ruby file in Vim…
In .vimrc:
au FileType ruby source ~/.vim/nitin/ruby.vim
# The above needs the "filetype plugin on" included in the .vimrc
In .vim/nitin/ruby.vim:
map <F5> :w<CR>:!ruby %<CR>
PS: Comments in the .vim files begin with the double-quote character
PPS: Apparently, we can also do an “au BufRead *.rb ….” instead of using the file type plugin