dotfiles/editors/vim/ruby.vim

12 lines
487 B
VimL
Raw Normal View History

2013-11-06 19:36:55 +11:00
autocmd FileType cucumber compiler cucumber | setl makeprg=cucumber\ \"%:p\"
autocmd FileType ruby
\ if expand('%') =~# '_test\.rb$' |
\ compiler rubyunit | setl makeprg=testrb\ \"%:p\" |
\ elseif expand('%') =~# '_spec\.rb$' |
\ compiler rspec | setl makeprg=rspec\ \"%:p\" |
\ else |
\ compiler ruby | setl makeprg=ruby\ -wc\ \"%:p\" |
\ endif
autocmd User Bundler
\ if &makeprg !~# 'bundle' | setl makeprg^=bundle\ exec\ | endif