Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create ctags only for c and h files in code

Tags:

c

tags

ctags

I have a compiled code. If i try generation the tags using the 'usr/bin/ctags -R *', it will include all the c,h,object files etc. So it is taking lot of time and also memory. Could you please let me know how to generate tags only for c/h files.

like image 947
chaitanyavarma Avatar asked May 02 '13 05:05

chaitanyavarma


2 Answers

Use the --languages parameter:

ctags --languages=C

like image 188
Max Avatar answered Sep 19 '22 15:09

Max


You can use a .ctagsignore file to exclude any unwanted files from the generated tags. The following is an example I use for my projects:

Contents of .ctagsignore:

bin
makefile
obj
tags
workspace.vim

And then generate tags with: -ctags -R [email protected]

This ignores every file in the bin, and obj folder, the makefile, the (future) generated tags file, and the workspace.vim file in the project directory. It essentially works like a .gitignore file, so you can use the wildcard (*.o) notation - myfolder/*.o ignores all object files in $PROJ_DIR$/myfolder/

like image 37
davidanderle Avatar answered Sep 19 '22 15:09

davidanderle