1 " Universal Ctags creator
2 " Maintainer: Sergey Matveev <stargrave@stargrave.org>
3 " License: GNU General Public License version 3 of the License or later
5 " Create "tags" file in your project's root first.
6 " Then :Ctags LANG to fill it.
8 if exists("g:loaded_mein_ctags") | finish | endif
9 let g:loaded_mein_ctags = 1
11 function! s:ctags(lang, onlyCmd, verbose)
14 echohl WarningMsg | echomsg "No tagfiles" | echohl None
17 let dst = sort(dst, {a, b -> len(a) > len(b) ? 1 : len(a) == len(b) ? 0 : -1})[0]
18 let src = "/" . join(split(dst, "/")[:-3], "/")
20 let dst = getcwd() . "/.tags/tags"
25 \"--languages=" . a:lang,
30 if a:verbose == v:true | let cmdline += ["--verbose"] | endif
31 let cmdline += ["-f", dst, src]
32 if a:onlyCmd == v:true
33 echo join(cmdline, " ")
36 execute "!" . join(cmdline, " ")
37 if a:verbose != v:true | redraw! | endif
40 command! -nargs=1 Ctags silent call s:ctags(<f-args>, v:false, v:false)
41 command! -nargs=1 Ctagsv silent call s:ctags(<f-args>, v:true, v:false)
42 command! -nargs=1 Ctagscmd call s:ctags(<f-args>, v:true, v:true)