Vim Tips Wiki
m (Single 'tags' file for a source tree moved to Single tags file for a source tree: Page moved by JohnBot to improve title)
(Change to TipImported template + severe manual clean)
Line 1: Line 1:
 
{{review}}
 
{{review}}
  +
{{TipImported
{{Tip
 
 
|id=804
 
|id=804
  +
|previous=803
|title=single 'tags' file for a source tree
 
  +
|next=805
|created=October 12, 2004 0:00
+
|created=October 12, 2004
 
|complexity=intermediate
 
|complexity=intermediate
 
|author=Dubhead
 
|author=Dubhead
 
|version=6.0
 
|version=6.0
 
|rating=94/37
 
|rating=94/37
 
}}
|text=
 
At the top of a source tree, create a tags file by
+
At the top of a source tree, create a tags file by
   
  +
<pre>
 
% ctags -R
  +
</pre>
   
 
This assumes Exuberant Ctags. The -R (or --recurse) option tells ctags to recurse into directories.
   
 
Then, set the tags option in ~/.vimrc as
% ctags -R
 
   
  +
<pre>
 
set tags=tags;
  +
</pre>
   
 
The last semicolon is the key here. When Vim tries to locate the 'tags' file, it first looks at the current directory, then the parent directory, then the parent of the parent, and so on.
   
 
This setting works nicely with 'set autochdir'. You need <tt>+path-extra</tt> feature for this tip.
(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* .
 
 
 
}}
 
   
== Comments ==
+
==References==
  +
*{{help|file-searching}}
You can also tag help/man files, and access it from vim with
 
commands like these in _vimrc:
 
   
  +
==Comments==
au FileType perl set tags^=$DOC/perl/tags
 
 
You can also tag help/man files, and access it from Vim with commands like these in vimrc:
au FileType cpp set tags^=$DOC/cpp/tags
 
   
  +
<pre>
 
au FileType perl set tags^=$DOC/perl/tags
 
au FileType cpp set tags^=$DOC/cpp/tags
  +
</pre>
   
perci merci
 
, October 27, 2004 14:12
 
 
----
 
----
<!-- parsed by vimtips.py in 0.538344 seconds-->
 

Revision as of 00:54, 25 November 2007

Tip 804 Printable Monobook Previous Next

created October 12, 2004 · complexity intermediate · author Dubhead · version 6.0


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

% ctags -R

This assumes 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, then the parent directory, then the parent of the parent, and so on.

This setting works nicely with 'set autochdir'. You need +path-extra feature for this tip.

References

Comments

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