Skip to content

Instantly share code, notes, and snippets.

@jdevera
Created April 5, 2015 21:35
Show Gist options
  • Save jdevera/be4205ac036c7f73c429 to your computer and use it in GitHub Desktop.
Save jdevera/be4205ac036c7f73c429 to your computer and use it in GitHub Desktop.
Visit the github page of a Vundle managed plugin
function! VundleVisitPluginPage(plugin_name)
if !exists('g:vundle#bundles')
echomsg 'Could not find Vundle plugins'
return
endif
if !exists('g:web_browser')
echomsg 'Set your web browser executable to g:web_browser'
return
endif
let uri = ''
for bundle in g:vundle#bundles
if bundle.name == a:plugin_name
let uri = bundle.uri
break
endif
endfor
if empty(uri)
echomsg 'Could not find Plugin' plugin_name
return
endif
if uri !~ 'github.com'
echomsg 'Plugin' plugin_name 'has a non-github URI:' bundle.uri
return
endif
silent exec '!' . g:web_browser . ' ' . uri
redraw!
endfunction
function! VundleWebComplete(a,c,d)
if exists('g:vundle#bundles')
return join(map(copy(g:vundle#bundles), 'v:val.name'), "\n")
endif
endfunction
command! -nargs=1 -complete=custom,VundleWebComplete VundleWeb
\ call VundleVisitPluginPage(<f-args>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment