diff --git a/vimrc b/vimrc index e39ebab..ca6bddd 100644 --- a/vimrc +++ b/vimrc @@ -246,6 +246,16 @@ xmap ah (GitGutterTextObjectOuterVisual) " vim-fugitive packadd! vim-fugitive " https://github.com/tpope/vim-fugitive.git +" Copy Git permalink to clipboard for either current line or range +function! CopyGitURLToLineOrRange() range + if a:firstline == a:lastline + execute ".GBrowse!" + else + execute a:firstline . "," . a:lastline . "GBrowse!" + endif +endfunction +map u :call CopyGitURLToLineOrRange() + " vim-go " Doesn't work in after/ftplugin/go.vim: let g:go_def_mapping_enabled = 0