Thursday 15 May 2014

vim - ctags problem when generating tags for .h and .c file in two different directory -


Now I have two directories, all header files are included in * .h directory / inc, whereas all c files *. C / src is stored in the directory.

Such a directory, (/ Project is an up-level directory):

  / project-- | --- - / inc | ---- / src  

I want to use ctrl +] to determine the definition of a parameter, in the example source file a function . C. How to generate those tags?

My method is:

  (1) CD / Project directory (2) ctags inc / * .h src / *. C  

Then a tag file is generated, however, when I open an example file and use "Ctrl +]", I can not take it into its definition Why ???

Do I have to / src ??? Need to create a tag file under

? thanks a lot!

, try typing:

  1. PWD
  2. : Set tags

Verify that the path of your tagfile exists in the output of 2, the relative path Which is the output of 1.

NOTE: You can change your local .vimrc . You can set the tag variable as part of

>

Update: It is common to set tags on tags, .. / tags, .. .. .. / tags on one set. With this pattern, Vim will use the first tag file which will find it relative to your folder structure (again your pwd .)


No comments:

Post a Comment