Skip to Content
Learning the vi and Vim Editors, 7th Edition
book

Learning the vi and Vim Editors, 7th Edition

by Arnold Robbins, Elbert Hannah, Linda Lamb
July 2008
Beginner
492 pages
16h
English
O'Reilly Media, Inc.
Content preview from Learning the vi and Vim Editors, 7th Edition

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
CommandFunction
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.

[count]ta[g][!]

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

[count]po[p][!]

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

tags

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.

[count]tn[ext][!]

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

[count]tp[revious][!]

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

[count]tN[ext][!]
[count]tr[ewind][!]

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

tl[ast][!]

Jump to the last matching tag.

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 8th Edition

Learning the vi and Vim Editors, 8th Edition

Arnold Robbins, Elbert Hannah
Vim Masterclass

Vim Masterclass

Jason Cannon
Mastering Vim

Mastering Vim

Ruslan Osipov

Publisher Resources

ISBN: 9780596529833Errata Page