Enhanced Tags and Tag Stacks

Vim and most of the other vi clones provide enhanced tagging facilities. You can stack locations on a tag stack, and with Exuberant ctags, tag more items than just functions.

Exuberant ctags

The “Exuberant ctagsprogram was written by Darren Hiebert (home page: http://ctags.sourceforge.net/). As of this writing, the current version is 5.8.

This enhanced tags file format has three tab-separated fields: the tag name (typically an identifier), the source file containing the tag, and the location of the identifier. Extended attributes are placed after a separating ;". Each attribute is separated from the next by a tab character and consists of two colon-separated subfields. The first subfield is a keyword describing the attribute; the second is the actual value.

Extended ctags keywords

Keyword

Meaning

arity

For functions

class

For C++ member functions and variables

enum

For values in an enum data type

file

For static tags, i.e., local to the file

function

For local tags

kind

The value is a single letter that indicates the lexical type of the tag

scope

Intended mostly for C++ class member functions

struct

For fields in a struct

If the field doesn’t contain a colon, it’s assumed to be of type kind.

Within the value part of each attribute, the backslash, tab, carriage return, and newline characters should be encoded as \, , , and , respectively.

Solaris vi Tag Stacking

vi provides ex and vi commands for managing the tag stack.

Tag commands—ex

Command

Function

ta[g][!] tagstring

Edit the file containing tagstring as defined in the tags file

po[p][!]

Pop the tag stack by one element

Tag commands—vi

Command

Function

^]

Look up the location of the identifier under the cursor in the tags file and move to that location; if tag stacking is enabled, the current location is automatically pushed onto the tag stack

^T

Return to the previous location in the tag stack, i.e., pop off one element

Tag management options

Option

Function

taglength, tl

Controls the number of significant characters in a tag to be looked up; the default value of zero indicates that all characters are significant

tags, tagpath

The value is a list of filenames in which to look for tags; the default value is "tags /usr/lib/tags"

tagstack

When set to true, vi stacks each location on the tag stack

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.58.196