I use ctags -Rslower than using ctags with a file like ctags -L input. So what I did in my current java projects with about 3,000 files in it, to ask git to give me the paths to the files, collect them in an archive (e.g. javafiles.txt), and then execute it ctags -L javafiles.txtoutside the editor.
If you do not want to leave vim, you can use shellscript to call Ctags with the necessary parameters. I.E. Create a file autotags.shin the root directory of the git project with the following lines:
#!/bin/bash
set -e
git ls-files | sed "/\.cpp$/!d" >> cscope.files
ctags -L cscope.files
Do not forget to give him permission to execute. When you have shellscript, your vimscript code will look like this:
function! UpdateTags()
let curdir = getcwd()
let gitdir = finddir('.git', '.;/')
if isdirectory(gitdir)
let l:rootdir = fnamemodify(gitdir, ':h')
execute 'silent cd ' . l:rootdir
execute 'silent !./autotags.sh &'
if has("cscope")
execute 'silent !cscope -bkq &'
execute 'silent cs reset'
endif " has("cscope")
execute 'silent cd ' . curdir
endif
endfunction
- cscope.files, , cscope . http://cscope.sourceforge.net/large_projects.html
, , , , , , ctags cscope.