Enhanced Tags

The “Exuberant ctags” program is a ctags clone that is considerably more capable than Unix ctags. It produces an extended tags file format that makes the tag searching and matching process more flexible and powerful. We describe the Exuberant version first, since it is supported by most of the vi clones.

This section also describes tag stacks: the ability to save multiple locations visited with the :tag or ^] commands. All of the clones support tag stacking.

Exuberant ctags

The Exuberant ctags program was written by Darren Hiebert, and, as of this writing, the current version is 5.7. Its home page is http://ctags.sourceforget.net/. The following list of the program’s features is adapted from the README file in the ctags distribution:

  • It is capable of generating tags for all types of C and C++ language tags, including class names, macro definitions, enum names, enumerators (values inside an enumeration), function (method) definitions, function (method) prototypes/declarations, structure members and class data members, struct names, typedefs, union names, and variables. (Whew!)

  • It supports both C and C++ code.

  • Twenty-nine other languages are also supported, including C# and Java.

  • It is very robust in parsing code and is far less easily fooled by code containing #if preprocessor conditional constructs.

  • It can be used to print out a human-readable list of selected objects found in source files.

  • It supports generation of GNU Emacs-style tag files (etags).

  • It works on Amiga, Cray, ...

Get Learning the vi and Vim Editors, 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.