How to use gtags -v to create index but skipping some subdirectories

拟墨画扇 提交于 2019-12-24 03:22:33

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!