What's the proper way to use ctags?

David Scheidt dmschei at attglobal.net
Wed Dec 8 22:52:17 PST 2004

> Let say I want to quickly browse through all the source files in a 
> given
> directory. What I tried was I ran ctags -R source_dir, which builds a
> tag file for the entire source. When I start vim in that directory and
> view files in the sub directories, tag works just fine. But when I go
> into other directory(outside of vim), since there is no tag file there,
> I can't use the tag feature anymore.
> I could ran ctag in all sub directories, but then I won't be able to
> search for functions that are define outside of the sub directory. So
> what's the proper way to use ctag?

You need to tell vim where your tag files are.

:set tags=./tags,/path/to/your/tags

(note the lack of a space character there!)

I think the default is just ./tags.  Or perhaps it's "tags,./tags".  I 
don't remember.  Read the vim help files on tags

:help tags



More information about the freebsd-questions mailing list