vimrc: add gotags.vimrc.vim

This commit is contained in:
surtur 2022-04-29 00:26:07 +02:00
parent a295a52164
commit 44334b81de
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 34 additions and 0 deletions

28
.vim/gotags.vimrc.vim Normal file
View File

@ -0,0 +1,28 @@
" From https://github.com/jstemmer/gotags
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }

View File

@ -279,6 +279,12 @@ xnoremap <silent>"+y y:call system("wl-copy", @")<cr>
nnoremap <silent>"+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p
"------------------------------------
" go_tags
"------------------------------------
exec "source " . escape(expand("~/.vim"),' ') . "/" . "gotags.vimrc"
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<left>"