Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ctags, generate tags using multiple paths?

Tags:

vim

ctags

When I build/update my tags file, ctags starts at the current directory and works its way down recursively.

I would like for it to also include a completely different search path, a mapped network drive, and add those results to my tags file as well.

Is there any way to do that?

like image 417
ash Avatar asked Feb 14 '23 21:02

ash


1 Answers

When the files in the other directory are related and often change together with the current directory hierarchy, I'd write a custom :Ctags command that supplies the other path to the :!ctags call.

If the other files are unrelated, and rarely update (as based on your comments seems to be the case), I'd run ctags there separately and include them via

:set tags+=/path/to/other/dir/tags

NOTE: Add the tag filename at the end, else there will be "tag not found" error. By default the name is tags but it could be renamed with -f option as below.

ctags -f my_tags -R
:set tags+=/path/to/other/dir/my_tags
like image 89
Ingo Karkat Avatar answered Feb 27 '23 00:02

Ingo Karkat