Vim: how to get to the definition in an external C header file

I am looking at C code. I came across a variable that is defined in the header file. How can I move the cursor under this variable and move on to its definition?

thank

+5
source share
1 answer

Achieving this in vim can be done using the tag file.

You can create a tag file using the ctagsor program exhuberant-ctags.

cd in your project directory and run:

ctags -R

This will create a file with a name tagsthat contains a list of all the characters in your source code with their location.

Vim , , . , CTRL-], . , , CTRL-T.

. :help tags, :help CTRL-] :help CTRL-T

Vim . , , . tags:

set tags=./tags,./TAGS,tags,TAGS,/mytags/library1,/mytags/library2

./tags,./TAGS,tags,TAGS - tags; tags tags .

+5

All Articles