Skip to content

Instantly share code, notes, and snippets.

@tobynet
Created September 7, 2012 14:02
Show Gist options
  • Save tobynet/3666491 to your computer and use it in GitHub Desktop.
Save tobynet/3666491 to your computer and use it in GitHub Desktop.
a part of vimrc for ruby bundler with vim-quickrun
" vim-quickrunで ruby の bundler を考慮する
augroup quickrun_ruby_config
autocmd!
autocmd FileType ruby call s:quickrun_ruby_config()
augroup END
function! s:quickrun_ruby_config()
" detect "bundler" by checking "Gemfile" from upper directory of current file
let execs = executable('bundle') &&
\ findfile('Gemfile', '.;') != '' ? 'bundle exec ' : ''
" buffer local setting for quickrun
let b:quickrun_config = {'exec': execs . '%c %o %s %a'}
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment