Skip to content

bahejl/Intelligent_Tags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Intelligent Tags is designed to handle tag creation for you.  Tradionally, you
would run ctags on your project at regular intervals (or in a cron job), but I
struggled with this approach for several reasons:
* I'm initially not familiar with the project structure of many of the
* projects I work on, so I have to chase down the includes until I feel
* comfortable that I know where the project ends/begins.  This is a large
* overhead, and prevents me from using tags when I need them the most: while
* getting familiar with a project As I actively work on a project, updating
* the tags once a day, or even every hour, just doesn't cut it.  I would like
* the tags to be updated as soon as the file is updated.


Intelligent Tags solves these problems by using two tools.  First, it uses
Vim's built-in options 'include', and 'includeexpr' to determine any/all
included files whose tags should be used. The depth of this 'include search'
can be set by the user to any level, including infinite depth (all includes of
includes of includes, etc) and zero depth (current file only).  In order for
this to work properly, Vim's path option must be set correctly.  You can check
if it is correct by running the Vim command ':checkpath'.  For more
information on setting your path type ':h path'.

The second tool Intelligent Tags uses is exhuberant ctags.  Intelligent Tags
uses exhuberant ctags' report of supported languages to add a FileType
autocommand for each type of supported file.  I want my tags updated as soon
as I make a change to a file, but if you use the tradional method of having a
single tags file per project that can take quite a while -- especially for a
large project.  To work around that problem, Intelligent Tags creates a
seperate tags file for each source file, and only updates those that are out
of date.

This methodolgy begins to break down for some languages, such as C, where the
following problems exist:
* foo.c includes bar.h, followed by baz.h, so (almost magically) everything in
* bar.h is available to baz.h.  Because Intelligent Tags works on a per-file
* and not per-project basis, it is impossible (as far as I can tell) for
* Intelligent Tags to know that bar.h's tags should be included based only on
* the information in baz.h.  foo.c includes bar.h, which contains externals
* defined in bar.c.  Intelligent Tags works around this problem by allowing
* for a special 'header' option.  If this is defined, when Intelligent Tags
* finds any included file whose extension is recognized as a header, it will
* search for a source file of the same name and include its tags as well.

In the end, you should be able to open any exhuberant ctags supported file,
and get all of the tags generated for you for free!

About

Vim script to intelligently (and automatically) call ctags

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published