]> Sergey Matveev's repositories - dotfiles.git/blob - vim/.vim/plugin/ctags.vim
Initial
[dotfiles.git] / vim / .vim / plugin / ctags.vim
1 " Exuberant Ctags creator
2 " Maintainer: Sergey Matveev <stargrave@stargrave.org>
3 " License: GNU General Public License version 3 of the License or later
4 "
5 " Create "tags" file in your project's root first.
6 " Then :Ctags LANG to fill it.
7
8 function! s:ctags(lang, verbose)
9     let dst = tagfiles()[0]
10     let src = "/" . join(split(dst, "/")[:-2], "/")
11     if dst[0] != "/"
12         let dst = getcwd() . "/tags"
13         let src = getcwd()
14     endif
15     let cmdline = [
16         \'uctags',
17         \'--languages=' . a:lang,
18         \'--python-kinds=-i',
19         \'--recurse',
20     \]
21     if a:verbose == v:true | let cmdline += ['--verbose'] | endif
22     let cmdline += ['-f', dst, src]
23     execute "!" . join(cmdline, " ")
24     if a:verbose != v:true | redraw! | endif
25 endfunction
26
27 command! -nargs=1 Ctags silent call s:ctags(<f-args>, v:false)
28 command! -nargs=1 Ctagsv silent call s:ctags(<f-args>, v:true)