m (Single 'tags' file for a source tree moved to Single tags file for a source tree: Page moved by JohnBot to improve title)

Revision as of 09:56, October 18, 2007

Previous TipNext Tip

Tip: #804 - Single tags file for a source tree

Created: October 12, 2004 0:00 Complexity: intermediate Author: Dubhead Version: 6.0 Karma: 94/37 Imported from: Tip#804

At the top of a source tree, create a tags file by

% ctags -R

(assuming Exuberant Ctags). The -R (or --recurse) option tells ctags to recurse into directories.

Then, set the tags option in ~/.vimrc as

set tags=tags;

The last semicolon is the key here. When Vim tries to locate the 'tags' file, it first looks at the current directory, and then looks at the parent directory, then the parent of the parent...

This setting works nicely together with 'set autochdir'. You need +path-extra feature for this tip. Also see *file-searching* .


You can also tag help/man files, and access it from vim with commands like these in _vimrc:

au FileType perl set tags^=$DOC/perl/tags au FileType cpp set tags^=$DOC/cpp/tags

perci merci , October 27, 2004 14:12

Community content is available under CC-BY-SA unless otherwise noted.