问题
I am trying to run 'gtags -v' to build index for my large code base. from this link: Emacs as an IDE for large C++ projects
My question is how can I tell gtags to skip walk into some directories (not necessary top level) "e.g. 'out', '.git', 'tools'?
Thank you.
回答1:
I believe you can skip certain filetypes and directories with the --exclude
argument.
--exclude=*.txt,*.html
Edit: It seems my answer works for ctags, but may not exist in gtags any more. Please see this page for a possible solution to your problem.
回答2:
You can add the file/dirs you want to exclude to your ~/.globalrc file in the common: skip:
section.
For example:
common:\
:skip=HTML/,HTML.pub/,tags,TAGS,ID,y.tab.c,y.tab.h,gtags.files,cscope.files,cscope.out,cscope.po.out,cscope.in.out,SCCS/,RCS/,CVS/,CVSROOT/,{arch}/,autom4te.cache/,*.orig,*.rej,*.bak,*~,#*#,*.swp,*.tmp,*_flymake.*,*_flymake,*.o,*.a,*.so,*.lo,*.zip,*.gz,*.bz2,*.xz,*.lzh,*.Z,*.tgz,*.min.js,*min.css:
P.S. If you don't have .globalrc
in your HOME dir, you can copy it from gtags.conf
from source code archive of global
.
This page may help you.
来源:https://stackoverflow.com/questions/23703585/how-to-use-gtags-v-to-create-index-but-skipping-some-subdirectories