summaryrefslogtreecommitdiff
path: root/vim-plug/plugins.vim
diff options
context:
space:
mode:
authorChris <[email protected]>2020-04-24 18:53:23 -0400
committerChris <[email protected]>2020-04-24 18:53:23 -0400
commit74ac89131c7d8e09767bf5b137ba3cc5d1da9842 (patch)
tree54b54c9744653851e366af83975c7e9492b331ff /vim-plug/plugins.vim
parent8a1ca71059ee0fab7d251de1ead877fa8d72f3b3 (diff)
auto push
Diffstat (limited to 'vim-plug/plugins.vim')
-rw-r--r--vim-plug/plugins.vim63
1 files changed, 63 insertions, 0 deletions
diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim
index cb202617..baaab75c 100644
--- a/vim-plug/plugins.vim
+++ b/vim-plug/plugins.vim
@@ -18,4 +18,67 @@ call plug#begin('~/.config/nvim/autoload/plugged')
Plug 'joshdick/onedark.vim'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
call plug#end()
+
+" Automatically install missing plugins on startup
+autocmd VimEnter *
+ \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
+ \| PlugInstall --sync | q
+ \| endif
+
+" Press gx to open the GitHub URL for a plugin or a commit with the default browser.
+function! s:plug_gx()
+ let line = getline('.')
+ let sha = matchstr(line, '^ \X*\zs\x\{7,9}\ze ')
+ let name = empty(sha) ? matchstr(line, '^[-x+] \zs[^:]\+\ze:')
+ \ : getline(search('^- .*:$', 'bn'))[2:-2]
+ let uri = get(get(g:plugs, name, {}), 'uri', '')
+ if uri !~ 'github.com'
+ return
+ endif
+ let repo = matchstr(uri, '[^:/]*/'.name)
+ let url = empty(sha) ? 'https://github.com/'.repo
+ \ : printf('https://github.com/%s/commit/%s', repo, sha)
+ call netrw#BrowseX(url, 0)
+endfunction
+
+augroup PlugGx
+ autocmd!
+ autocmd FileType vim-plug nnoremap <buffer> <silent> gx :call <sid>plug_gx()<cr>
+augroup END