Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recursive ctags for only one filetype

I want to use ctags to create tags for a project, that is distributed over several subfolders.

I know that this can be done using ctags -R *.

Is it possible to restrict the generation to only use files with the same suffix? For example it should create tags for all *.c files but not for *.h files or Makefiles.

Thank you!

like image 222
Tim Avatar asked Dec 05 '12 12:12

Tim


2 Answers

I usually use

find -name '*.c' -exec ctags {} +
like image 124
choroba Avatar answered Oct 26 '22 03:10

choroba


If you use Universal Ctags you can use --languages option. Example for parsing only php files is

ctags -R --languages=php

You can combine multiple languages using comma. To get a list of supported languages use --list-languages option.

like image 33
azhidkov Avatar answered Oct 26 '22 02:10

azhidkov