Pages

Wednesday, April 25, 2007

Handling tags in the vim editor.

* How to create tags for your project?
Into project's source code directory, execute the follow command:
# ctags -R
It goes to generate the "tags" file in the current directory.

* How the vim editor find my tags files?
By default the vim search the tags file in the current directory,
where you run the vim editor, but
to set the path of the tags file,
you can put the follow line into the .vimrc file at home directory
of the user:
set tags="put here your tags file path"

* How to handle tags in the vim editor?
CTRL + ] t
o go to the file source with the first occurrence
of the tag that it's under the cursor.
g + ] to list all occurrences of the tags that it's under the cursor,
chose one by number at the left and press ENTER.

1 comment:

Madbawa said...

In the vim tags tip, the quotes should not be present. It doesn't work if quotes are there.

this works though:

set tags=/home/valhalla/src/tags