~gpanders/dotfiles

ref: c8e63bac959db19c138dcc3198a56514f0b444ff dotfiles/.vim/after/plugin/gutentags.vim -rw-r--r-- 861 bytes
c8e63bacGreg Anders Manage dotfiles directly in home directory 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
" vim-gutentags configuration
" Author: Greg Anders <greg@gpanders.com>
" Date: 2018-12-03

if !get(g:, 'loaded_gutentags')
    finish
endif

let s:save_cpo = &cpo
set cpo&vim

let g:gutentags_ctags_extra_args = ['--tag-relative=yes']
let g:gutentags_ctags_exclude = ['build']
let g:gutentags_file_list_command = {
            \ 'markers': {
            \   '.git': 'git ls-files -co --exclude-standard',
            \ }}

" Keep tags files in git repositories under .git/tags
function! GutentagsInitUserFunc(path) abort
    try
        let root = gutentags#get_project_root(a:path)
        if !empty(root) && isdirectory(root . '/.git')
            let b:gutentags_tagfile = '.git/tags'
        endif
    catch /^gutentags\:/
    endtry
    return 1
endfunction

let g:gutentags_init_user_func = 'GutentagsInitUserFunc'

let &cpo = s:save_cpo
unlet s:save_cpo