vimrc: Add CopyGitURLToLineOrRange mapping

This commit is contained in:
Rob Watson 2021-04-09 11:24:54 +02:00
parent 575c216529
commit bc51900e59
1 changed files with 10 additions and 0 deletions

10
vimrc
View File

@ -246,6 +246,16 @@ xmap ah <Plug>(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 <leader>u :call CopyGitURLToLineOrRange()<cr>
" vim-go
" Doesn't work in after/ftplugin/go.vim:
let g:go_def_mapping_enabled = 0