mirror of
1
0
Fork 0
ultimate-vim/sources_non_forked/vim-go/ftplugin/go/tagbar.vim

58 lines
1.2 KiB
VimL
Raw Normal View History

2014-10-31 17:30:24 -04:00
" Check if tagbar is installed under plugins or is directly under rtp
2015-07-13 06:22:46 -04:00
" this covers pathogen + Vundle/Bundle
2014-10-31 17:30:24 -04:00
"
" Also make sure the ctags command exists
"
if !executable('ctags')
2016-06-26 07:12:36 -04:00
finish
2014-10-31 17:30:24 -04:00
elseif globpath(&rtp, 'plugin/tagbar.vim') == ""
2016-06-26 07:12:36 -04:00
finish
2014-10-31 17:30:24 -04:00
endif
if !exists("g:go_gotags_bin")
2016-06-26 07:12:36 -04:00
let g:go_gotags_bin = "gotags"
2014-10-31 17:30:24 -04:00
endif
function! s:SetTagbar()
2016-06-26 07:12:36 -04:00
let bin_path = go#path#CheckBinPath(g:go_gotags_bin)
if empty(bin_path)
return
endif
2014-10-31 17:30:24 -04:00
2016-06-26 07:12:36 -04:00
if !exists("g:tagbar_type_go")
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports',
\ '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'
\ },
2016-08-20 07:23:52 -04:00
\ 'ctagsbin' : bin_path,
2016-06-26 07:12:36 -04:00
\ 'ctagsargs' : '-sort -silent'
\ }
endif
2014-10-31 17:30:24 -04:00
endfunction
call s:SetTagbar()
2016-06-26 07:12:36 -04:00
" vim: sw=2 ts=2 et