Tag Stacking

Tag stacking is described earlier in the section Tag Stacks. Besides moving back and forth among the tags you search for, you can choose among multiple matching tags. You can also do tag selection and window splitting with one command. The Vim ex mode commands for working with tags are provided in Table 14-1.

Table 14-1. Vim tag commands
ta[g][!] [tagstring]

Edit the file containing tagstring as defined in the tags file. The ! forces Vim to switch to the new file if the current buffer has been modified but not saved. The file may or may not be written out, depending on the setting of the autowrite option.


Jump to the count’th newer entry in the tag stack.


Pop a cursor position off the stack, restoring the cursor to its previous position. If supplied, go to the count’th older entry.


Display the contents of the tag stack.

ts[elect][!] [tagstring]

List the tags that match tagstring, using the information in the tags file(s). If no tagstring is given, the last tag name from the tag stack is used.

sts[elect][!] [tagstring]

Like :tselect, but splits the window for the selected tag.


Jump to the count’th next matching tag (default is 1).


Jump to the count’th previous matching tag (default is 1).


Jump to the first matching tag. With count, jump to the count’th matching tag.


Jump to the last matching tag.

Normally, Vim shows you which matching tag out of how many ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.