n179911
n179911

Reputation: 20311

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

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.

Upvotes: 3

Views: 1521

Answers (2)

aglasser
aglasser

Reputation: 3069

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.

Upvotes: 2

krizex
krizex

Reputation: 349

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.

Upvotes: 4

Related Questions