Guest User

Untitled

a guest
Jun 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. " Does what it sounds like. Opens a gem in a new tab,
  2. " getting the location from 'bundle show <gemname>'
  3.  
  4. function! s:BundleOpen(Gem) abort
  5. let path = system('bundle show '.a:Gem)
  6. if v:shell_error != 0
  7. echo 'failed to run command'
  8. else
  9. exe 'tabedit '.substitute(path, '\v\C\n$', '', '') | :lcd %
  10. endif
  11. endfunction
  12.  
  13. " :BO capybara
  14. :command! -nargs=1 BO :call s:BundleOpen(<q-args>)
Add Comment
Please, Sign In to add comment