summaryrefslogtreecommitdiffstats
path: root/DateTimeMeter.h
AgeCommit message (Expand)Author
2021-05-10cleaned up includes with iwyumayurdahibhate
2020-10-07Mark Object instances constChristian Göttsche
2020-10-05DateMeter followupChristian Göttsche
2020-10-05Add a date and datetime meter (#159)Michael F. Schönitzer
#n52'>52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860
*tagsrch.txt*   For Vim version 8.1.  Last change: 2018 May 04


		  VIM REFERENCE MANUAL    by Bram Moolenaar


Tags and special searches				*tags-and-searches*

See section |29.1| of the user manual for an introduction.

1. Jump to a tag		|tag-commands|
2. Tag stack			|tag-stack|
3. Tag match list		|tag-matchlist|
4. Tags details			|tag-details|
5. Tags file format		|tags-file-format|
6. Include file searches	|include-search|

==============================================================================
1. Jump to a tag					*tag-commands*

							*tag* *tags*
A tag is an identifier that appears in a "tags" file.  It is a sort of label
that can be jumped to.  For example: In C programs each function name can be
used as a tag.  The "tags" file has to be generated by a program like ctags,
before the tag commands can be used.

With the ":tag" command the cursor will be positioned on the tag.  With the
CTRL-] command, the keyword on which the cursor is standing is used as the
tag.  If the cursor is not on a keyword, the first keyword to the right of the
cursor is used.

The ":tag" command works very well for C programs.  If you see a call to a
function and wonder what that function does, position the cursor inside of the
function name and hit CTRL-].  This will bring you to the function definition.
An easy way back is with the CTRL-T command.  Also read about the tag stack
below.

						*:ta* *:tag* *E426* *E429*
:[count]ta[g][!] {name}
			Jump to the definition of {name}, using the
			information in the tags file(s).  Put {name} in the
			tag stack.  See |tag-!| for [!].
			{name} can be a regexp pattern, see |tag-regexp|.
			When there are several matching tags for {name}, jump
			to the [count] one.  When [count] is omitted the
			first one is jumped to. See |tag-matchlist| for
			jumping to other matching tags.

g<LeftMouse>						*g<LeftMouse>*
<C-LeftMouse>					*<C-LeftMouse>* *CTRL-]*
CTRL-]			Jump to the definition of the keyword under the
			cursor.  Same as ":tag {name}", where {name} is the
			keyword under or after cursor.
			When there are several matching tags for {name}, jump
			to the [count] one.  When no [count] is given the
			first one is jumped to. See |tag-matchlist| for
			jumping to other matching tags.
			{Vi: identifier after the cursor}

							*v_CTRL-]*
{Visual}CTRL-]		Same as ":tag {name}", where {name} is the text that
			is highlighted.  {not in Vi}

							*telnet-CTRL-]*
CTRL-] is the default telnet escape key.  When you type CTRL-] to jump to a
tag, you will get the telnet prompt instead.  Most versions of telnet allow
changing or disabling the default escape key.  See the telnet man page.  You
can 'telnet -E {Hostname}' to disable the escape character, or 'telnet -e
{EscapeCharacter} {Hostname}' to specify another escape character.  If
possible, try to use "ssh" instead of "telnet" to avoid this problem.

							*tag-priority*
When there are multiple matches for a tag, this priority is used:
1. "FSC"  A full matching static tag for the current file.
2. "F C"  A full matching global tag for the current file.
3. "F  "  A full matching global tag for another file.
4. "FS "  A full matching static tag for another file.
5. " SC"  An ignore-case matching static tag for the current file.
6. "  C"  An ignore-case matching global tag for the current file.
7. "   "  An ignore-case matching global tag for another file.
8. " S "  An ignore-case matching static tag for another file.

Note that when the current file changes, the priority list is mostly not
changed, to avoid confusion when using ":tnext".  It is changed when using
":tag {name}".

The ignore-case matches are not found for a ":tag" command when:
- the 'ignorecase' option is off and 'tagcase' is "followic"
- 'tagcase' is "match"
- 'tagcase' is "smart" and the pattern contains an upper case character.
- 'tagcase' is "followscs" and 'smartcase' option is on and the pattern
  contains an upper case character.

The ignore-case matches are found when:
- a pattern is used (starting with a "/")
- for ":tselect"
- when 'tagcase' is "followic" and 'ignorecase' is off
- when 'tagcase' is "match"
- when 'tagcase' is "followscs" and the 'smartcase' option is off

Note that using ignore-case tag searching disables binary searching in the
tags file, which causes a slowdown.  This can be avoided by fold-case sorting
the tag file. See the 'tagbsearch' option for an explanation.

==============================================================================
2. Tag stack				*tag-stack* *tagstack* *E425*

On the tag stack is remembered which tags you jumped to, and from where.
Tags are only pushed onto the stack when the 'tagstack' option is set.

g<RightMouse>						*g<RightMouse>*
<C-RightMouse>					*<C-RightMouse>* *CTRL-T*
CTRL-T			Jump to [count] older entry in the tag stack
			(default 1).  {not in Vi}

						*:po* *:pop* *E555* *E556*
:[count]po[p][!]	Jump to [count] older entry in tag stack (default 1).
			See |tag-!| for [!].  {not in Vi}

:[count]ta[g][!]	Jump to [count] newer entry in tag stack (default 1).
			See |tag-!| for [!].  {not in Vi}

							*:tags*
:tags			Show the contents of the tag stack.  The active
			entry is marked with a '>'.  {not in Vi}

The output of ":tags" looks like this:

   # TO tag      FROM line  in file/text
   1  1 main		 1  harddisk2:text/vim/test
 > 2  2 FuncA		58  i = FuncA(10);
   3  1 FuncC	       357  harddisk2:text/vim/src/amiga.c

This list shows the tags that you jumped to and the cursor position before
that jump.  The older tags are at the top, the newer at the bottom.

The '>' points to the active entry.  This is the tag that will be used by the
next ":tag" command.  The CTRL-T and ":pop" command will use the position
above the active entry.

Below the "TO" is the number of the current match in the match list.  Note
that this doesn't change when using ":pop" or ":tag".

The line number and file name are remembered to be able to get back to where
you were before the tag command.  The line number will be correct, also when
deleting/inserting lines, unless this was done by another program (e.g.
another instance of Vim).

For the current file, the "file/text" column shows the text at the position.
An indent is removed and a long line is truncated to fit in the window.

You can jump to previously used tags with several commands.  Some examples:

	":pop" or CTRL-T	to position before previous tag
	{count}CTRL-T		to position before {count} older tag
	":tag"			to newer tag
	":0tag"			to last used tag

The most obvious way to use this is while browsing through the call graph of
a program.  Consider the following call graph:

	main  --->  FuncA  --->  FuncC
	      --->  FuncB

(Explanation: main calls FuncA and FuncB; FuncA calls FuncC).
You can get from main to FuncA by using CTRL-] on the call to FuncA.  Then
you can CTRL-] to get to FuncC.  If you now want to go back to main you can
use CTRL-T twice.  Then you can CTRL-] to FuncB.

If you issue a ":ta {name}" or CTRL-] command, this tag is inserted at the
current position in the stack.  If the stack was full (it can hold up to 20
entries), the oldest entry is deleted and the older entries shift one
position up (their index number is decremented by one).  If the last used
entry was not at the bottom, the entries below the last used one are
deleted.  This means that an old branch in the call graph is lost.  After the
commands explained above the tag stack will look like this:

   # TO tag	FROM line  in file/text
   1  1 main		1  harddisk2:text/vim/test
   2  1 FuncB	       59  harddisk2:text/vim/src/main.c

The |gettagstack()| function returns the tag stack of a specified window. The
|settagstack()| function modifies the tag stack of a window.

							*E73*
When you try to use the tag stack while it doesn't contain anything you will
get an error message.

==============================================================================
3. Tag match list				*tag-matchlist* *E427* *E428*

When there are several matching tags, these commands can be used to jump
between them.  Note that these commands don't change the tag stack, they keep
the same entry.

							*:ts* *:tselect*
:ts[elect][!] [name]	List the tags that match [name], using the
			information in the tags file(s).
			When [name] is not given, the last tag name from the
			tag stack is used.
			See |tag-!| for [!].
			With a '>' in the first column is indicated which is
			the current position in the list (if there is one).
			[name] can be a regexp pattern, see |tag-regexp|.
			See |tag-priority| for the priorities used in the
			listing.  {not in Vi}
			Example output:

>
	 nr pri kind tag		file
	  1 F	f    mch_delay		os_amiga.c
			mch_delay(msec, ignoreinput)
	> 2 F	f    mch_delay		os_msdos.c
			mch_delay(msec, ignoreinput)
	  3 F	f    mch_delay		os_unix.c
			mch_delay(msec, ignoreinput)
	Enter nr of choice (<CR> to abort):
<
			See |tag-priority| for the "pri" column.  Note that
			this depends on the current file, thus using
			":tselect xxx" can produce different results.
			The "kind" column gives the kind of tag, if this was
			included in the tags file.
			The "info" column shows information that could be
			found in the tags file.  It depends on the program
			that produced the tags file.
			When the list is long, you may get the |more-prompt|.
			If you already see the tag you want to use, you can
			type 'q' and enter the number.

							*:sts* *:stselect*
:sts[elect][!] [name]	Does ":tselect[!] [name]" and splits the window for
			the selected tag.  {not in Vi}

							*g]*
g]			Like CTRL-], but use ":tselect" instead of ":tag".
			{not in Vi}

							*v_g]*
{Visual}g]		Same as "g]", but use the highlighted text as the
			identifier.  {not in Vi}

							*:tj* *:tjump*
:tj[ump][!] [name]	Like ":tselect", but jump to the tag directly when
			there is only one match.  {not in Vi}

							*:stj* *:stjump*
:stj[ump][!] [name]	Does ":tjump[!] [name]" and splits the window for the
			selected tag.  {not in Vi}

							*g_CTRL-]*
g CTRL-]		Like CTRL-], but use ":tjump" instead of ":tag".
			{not in Vi}

							*v_g_CTRL-]*
{Visual}g CTRL-]	Same as "g CTRL-]", but use the highlighted text as
			the identifier.  {not in Vi}

							*:tn* *:tnext*
:[count]tn[ext][!]	Jump to [count] next matching tag (default 1).  See
			|tag-!| for [!].  {not in Vi}

							*:tp* *:tprevious*
:[count]tp[revious][!]	Jump to [count] previous matching tag (default 1).
			See |tag-!| for [!].  {not in Vi}

							*:tN* *:tNext*
:[count]tN[ext][!]	Same as ":tprevious".  {not in Vi}

							*:tr* *:trewind*
:[count]tr[ewind][!]	Jump to first matching tag.  If [count] is given, jump
			to [count]th matching tag.  See |tag-!| for [!].  {not
			in Vi}

							*:tf* *:tfirst*
:[count]tf[irst][!]	Same as ":trewind".  {not in Vi}

							*:tl* *:tlast*
:tl[ast][!]		Jump to last matching tag.  See |tag-!| for [!].  {not
			in Vi}

							*:lt* *:ltag*
:lt[ag][!] [name]	Jump to tag [name] and add the matching tags to a new
			location list for the current window.  [name] can be
			a regexp pattern, see |tag-regexp|.  When [name] is
			not given, the last tag name from the tag stack is
			used.  The search pattern to locate the tag line is
			prefixed with "\V" to escape all the special
			characters (very nomagic). The location list showing
			the matching tags is independent of the tag stack.
			See |tag-!| for [!].
			{not in Vi}

When there is no other message, Vim shows which matching tag has been jumped
to, and the number of matching tags: >
	tag 1 of 3 or more
The " or more" is used to indicate that Vim didn't try all the tags files yet.
When using ":tnext" a few times, or with ":tlast", more matches may be found.

When you didn't see this message because of some other message, or you just
want to know where you are, this command will show it again (and jump to the
same tag as last time): >
	:0tn
<
							*tag-skip-file*
When a matching tag is found for which the file doesn't exist, this match is
skipped and the next matching tag is used.  Vim reports this, to notify you of
missing files.  When the end of the list of matches has been reached, an error
message is given.

							*tag-preview*
The tag match list can also be used in the preview window.  The commands are
the same as above, with a "p" prepended.
{not available when compiled without the |+quickfix| feature}

							*:pts* *:ptselect*
:pts[elect][!] [name]	Does ":tselect[!] [name]" and shows the new tag in a
			"Preview" window.  See |:ptag| for more info.
			{not in Vi}

							*:ptj* *:ptjump*
:ptj[ump][!] [name]	Does ":tjump[!] [name]" and shows the new tag in a
			"Preview" window.  See |:ptag| for more info.
			{not in Vi}

							*:ptn* *:ptnext*
:[count]ptn[ext][!]	":tnext" in the preview window.  See |:ptag|.
			{not in Vi}

							*:ptp* *:ptprevious*
:[count]ptp[revious][!]	":tprevious" in the preview window.  See |:ptag|.
			{not in Vi}

							*:ptN* *:ptNext*
:[count]ptN[ext][!]	Same as ":ptprevious".  {not in Vi}

							*:ptr* *:ptrewind*
:[count]ptr[ewind][!]	":trewind" in the preview window.  See |:ptag|.
			{not in Vi}

							*:ptf* *:ptfirst*
:[count]ptf[irst][!]	Same as ":ptrewind".  {not in Vi}

							*:ptl* *:ptlast*
:ptl[ast][!]		":tlast" in the preview window.  See |:ptag|.
			{not in Vi}

==============================================================================
4. Tags details						*tag-details*

							*static-tag*
A static tag is a tag that is defined for a specific file.  In a C program
this could be a static function.

In Vi jumping to a tag sets the current search pattern.  This means that
the "n" command after jumping to a tag does not search for the same pattern
that it did before jumping to the tag.  Vim does not do this as we consider it
to be a bug.  You can still find the tag search pattern in the search history.
If you really want the old Vi behavior, set the 't' flag in 'cpoptions'.

							*tag-binary-search*
Vim uses binary searching in the tags file to find the desired tag quickly
(when enabled at compile time |+tag_binary|).  But this only works if the
tags file was sorted on ASCII byte value.  Therefore, if no match was found,
another try is done with a linear search.  If you only want the linear search,
reset the 'tagbsearch' option.  Or better: Sort the tags file!

Note that the binary searching is disabled when not looking for a tag with a
specific name.  This happens when ignoring case and when a regular expression
is used that doesn't start with a fixed string.  Tag searching can be a lot
slower then.  The former can be avoided by case-fold sorting the tags file.
See 'tagbsearch' for details.

							*tag-regexp*
The ":tag" and ":tselect" commands accept a regular expression argument.  See
|pattern| for the special characters that can be used.
When the argument starts with '/', it is used as a pattern.  If the argument
does not start with '/', it is taken literally, as a full tag name.
Examples: >
    :tag main
<	jumps to the tag "main" that has the highest priority. >
    :tag /^get
<	jumps to the tag that starts with "get" and has the highest priority. >
    :tag /norm
<	lists all the tags that contain "norm", including "id_norm".
When the argument both exists literally, and match when used as a regexp, a
literal match has a higher priority.  For example, ":tag /open" matches "open"
before "open_file" and "file_open".
When using a pattern case is ignored.  If you want to match case use "\C" in
the pattern.

							*tag-!*
If the tag is in the current file this will always work.  Otherwise the
performed actions depend on whether the current file was changed, whether a !
is added to the command and on the 'autowrite' option:

  tag in       file	   autowrite			~
current file  changed	!   option	  action	~
-----------------------------------------------------------------------------
    yes		 x	x     x	  goto tag
    no		 no	x     x	  read other file, goto tag
    no		yes    yes    x   abandon current file, read other file, goto
				  tag
    no		yes	no    on  write current file, read other file, goto
				  tag
    no		yes	no   off  fail
-----------------------------------------------------------------------------

- If the tag is in the current file, the command will always work.
- If the tag is in another file and the current file was not changed, the
  other file will be made the current file and read into the buffer.
- If the tag is in another file, the current file was changed and a ! is
  added to the command, the changes to the current file are lost, the other
  file will be made the current file and read into the buffer.
- If the tag is in another file, the current file was changed and the
  'autowrite' option is on, the current file will be written, the other
  file will be made the current file and read into the buffer.
- If the tag is in another file, the current file was changed and the
  'autowrite' option is off, the command will fail.  If you want to save
  the changes, use the ":w" command and then use ":tag" without an argument.
  This works because the tag is put on the stack anyway.  If you want to lose
  the changes you can use the ":tag!" command.

							*tag-security*
Note that Vim forbids some commands, for security reasons.  This works like
using the 'secure' option for exrc/vimrc files in the current directory.  See
|trojan-horse| and |sandbox|.
When the {tagaddress} changes a buffer, you will get a warning message:
	"WARNING: tag command changed a buffer!!!"
In a future version changing the buffer will be impossible.  All this for
security reasons: Somebody might hide a nasty command in the tags file, which
would otherwise go unnoticed.  Example: >
	:$d|/tag-function-name/
{this security prevention is not present in Vi}

In Vi the ":tag" command sets the last search pattern when the tag is searched
for.  In Vim this is not done, the previous search pattern is still remembered,
unless the 't' flag is present in 'cpoptions'.  The search pattern is always
put in the search history, so you can modify it if searching fails.

					*emacs-tags* *emacs_tags* *E430*
Emacs style tag files are only supported if Vim was compiled with the
|+emacs_tags| feature enabled.  Sorry, there is no explanation about Emacs tag
files here, it is only supported for backwards compatibility :-).

Lines in Emacs tags files can be very long.  Vim only deals with lines of up
to about 510 bytes.  To see whether lines are ignored set 'verbose' to 5 or
higher.

							*tags-option*
The 'tags' option is a list of file names.  Each of these files is searched
for the tag.  This can be used to use a different tags file than the default
file "tags".  It can also be used to access a common tags file.

The next file in the list is not used when:
- A matching static tag for the current buffer has been found.
- A matching global tag has been found.
This also depends on whether case is ignored.  Case is ignored when:
- 'tagcase' is "followic" and 'ignorecase' is set
- 'tagcase' is "ignore"
- 'tagcase' is "smart" and the pattern only contains lower case
  characters.
- 'tagcase' is "followscs" and 'smartcase' is set and the pattern only
  contains lower case characters.
If case is not ignored, and the tags file only has a match without matching
case, the next tags file is searched for a match with matching case.  If no
tag with matching case is found, the first match without matching case is
used.  If case is ignored, and a matching global tag with or without matching
case is found, this one is used, no further tags files are searched.

When a tag file name starts with "./", the '.' is replaced with the path of
the current file.  This makes it possible to use a tags file in the directory
where the current file is (no matter what the current directory is).  The idea
of using "./" is that you can define which tag file is searched first: In the
current directory ("tags,./tags") or in the directory of the current file
("./tags,tags").

For example: >
	:set tags=./tags,tags,/home/user/commontags

In this example the tag will first be searched for in the file "tags" in the
directory where the current file is.  Next the "tags" file in the current
directory.  If it is not found there, then the file "/home/user/commontags"
will be searched for the tag.

This can be switched off by including the 'd' flag in 'cpoptions', to make
it Vi compatible.  "./tags" will then be the tags file in the current
directory, instead of the tags file in the directory where the current file
is.

Instead of the comma a space may be used.  Then a backslash is required for
the space to be included in the string option: >
	:set tags=tags\ /home/user/commontags

To include a space in a file name use three backslashes.  To include a comma
in a file name use two backslashes.  For example, use: >
	:set tags=tag\\\ file,/home/user/common\\,tags

for the files "tag file" and "/home/user/common,tags".  The 'tags' option will
have the value "tag\ file,/home/user/common\,tags".

If the 'tagrelative' option is on (which is the default) and using a tag file
in another directory, file names in that tag file are relative to the
directory where the tag file is.

==============================================================================
5. Tags file format				*tags-file-format* *E431*

						*ctags* *jtags*
A tags file can be created with an external command, for example "ctags".  It
will contain a tag for each function.  Some versions of "ctags" will also make
a tag for each "#defined" macro, typedefs, enums, etc.

Some programs that generate tags files:
ctags			As found on most Unix systems.  Only supports C.  Only
			does the basic work.
							*Exuberant_ctags*
exuberant ctags		This a very good one.  It works for C, C++, Java,
			Fortran, Eiffel and others.  It can generate tags for
			many items.  See http://ctags.sourceforge.net.
etags			Connected to Emacs.  Supports many languages.
JTags			For Java, in Java.  It can be found at
			http://www.fleiner.com/jtags/.
ptags.py		For Python, in Python.  Found in your Python source
			directory at Tools/scripts/ptags.py.
ptags			For Perl, in Perl.  It can be found at
			http://www.eleves.ens.fr:8080/home/nthiery/Tags/.
gnatxref		For Ada.  See http://www.gnuada.org/.  gnatxref is
			part of the gnat package.


The lines in the tags file must have one of these three formats:

1.  {tagname}		{TAB} {tagfile} {TAB} {tagaddress}
2.  {tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress}
3.  {tagname}		{TAB} {tagfile} {TAB} {tagaddress} {term} {field} ..

The first is a normal tag, which is completely compatible with Vi.  It is the
only format produced by traditional ctags implementations.  This is often used
for functions that are global, also referenced in other files.

The lines in the tags file can end in <LF> or <CR><LF>.  On the Macintosh <CR>
also works.  The <CR> and <NL> characters can never appear inside a line.

							*tag-old-static*
The second format is for a static tag only.  It is obsolete now, replaced by
the third format.  It is only supported by Elvis 1.x and Vim and a few
versions of ctags.  A static tag is often used for functions that are local,
only referenced in the file {tagfile}.  Note that for the static tag, the two
occurrences of {tagfile} must be exactly the same.  Also see |tags-option|
below, for how static tags are used.

The third format is new.  It includes additional information in optional
fields at the end of each line.  It is backwards compatible with Vi.  It is
only supported by new versions of ctags (such as Exuberant ctags).

{tagname}	The identifier.  Normally the name of a function, but it can
		be any identifier.  It cannot contain a <Tab>.
{TAB}		One <Tab> character.  Note: previous versions allowed any
		white space here.  This has been abandoned to allow spaces in
		{tagfile}.  It can be re-enabled by including the
		|+tag_any_white| feature at compile time. *tag-any-white*
{tagfile}	The file that contains the definition of {tagname}.  It can
		have an absolute or relative path.  It may contain environment
		variables and wildcards (although the use of wildcards is
		doubtful).  It cannot contain a <Tab>.
{tagaddress}	The Ex command that positions the cursor on the tag.  It can
		be any Ex command, although restrictions apply (see
		|tag-security|).  Posix only allows line numbers and search
		commands, which are mostly used.
{term}		;" The two characters semicolon and double quote.  This is
		interpreted by Vi as the start of a comment, which makes the
		following be ignored.  This is for backwards compatibility
		with Vi, it ignores the following fields.
{field} ..	A list of optional fields.  Each field has the form:

			<Tab>{fieldname}:{value}

		The {fieldname} identifies the field, and can only contain
		alphabetical characters [a-zA-Z].
		The {value} is any string, but cannot contain a <Tab>.
		These characters are special:
			"\t" stands for a <Tab>
			"\r" stands for a <CR>
			"\n" stands for a <NL>
			"\\" stands for a single '\' character

		There is one field that doesn't have a ':'.  This is the kind
		of the tag.  It is handled like it was preceded with "kind:".
		See the documentation of ctags for the kinds it produces.

		The only other field currently recognized by Vim is "file:"
		(with an empty value).  It is used for a static tag.

The first lines in the tags file can contain lines that start with
	!_TAG_
These are sorted to the first lines, only rare tags that start with "!" can
sort to before them.  Vim recognizes two items.  The first one is the line
that indicates if the file was sorted.  When this line is found, Vim uses
binary searching for the tags file:
	!_TAG_FILE_SORTED<Tab>1<Tab>{anything} ~

A tag file may be case-fold sorted to avoid a linear search when case is
ignored.  (Case is ignored when 'ignorecase' is set and 'tagcase' is
"followic", or when 'tagcase' is "ignore".)  See 'tagbsearch' for details.
The value '2' should be used then:
	!_TAG_FILE_SORTED<Tab>2<Tab>{anything} ~

The other tag that Vim recognizes, but only when compiled with the
|+multi_byte| feature, is the encoding of the tags file:
	!_TAG_FILE_ENCODING<Tab>utf-8<Tab>{anything} ~
Here "utf-8" is the encoding used for the tags.  Vim will then convert the tag
being searched for from 'encoding' to the encoding of the tags file.  And when
listing tags the reverse happens.  When the conversion fails the unconverted
tag is used.

							*tag-search*