How to specify where to generate the tag file

I currently have a project directory such as

MainProject
|_ProjectA
|   |_src
|      |_file1.cpp
|      |_file2.cpp
|      |_.....
|      |_tags <---tag file generated here  
|_ProjectB
|   |_src
|      |_file3.cpp
|      |_file4.cpp
|      |_.....
       |_tags <---tag file generated here

Now file4.cpp uses the elements in file1.cpp, however it seems that since it is in a different folder, I get a message

cstag - tag not found

Currently I went into my ProjectA and ProjectB and did this for each

ctage -R .

as a result, a tag file is generated in each project. My question is how can I specify where to generate the tag file. In this case, all the tag files will be next to each other and, hopefully, this will solve this problem.

+4
source share
3 answers

The simplest solution would be to create a single file tags:

$ cd MainProject
$ ctags -R .

Vim , tags:

set tags=./tags;,tags;
+3

gutentags vim plugin . Gutentags , SCM (,.git) .

, , (g: gutentags_cache_dir). help gutentags.

+2

. , .

, VCS (IOW, .git/ .svn/), . gutentags - - . @apparat. , vim, - @romainl reddit , , SO. lh-tags, gutentags &tags , - , gutentags .

VCS, : " foo" " ". SO Q/A . () l:&tags , , , vim, , - (??) . NB: lh-tags , , &tags.

+1

Source: https://habr.com/ru/post/1682061/


All Articles