annotate runtime/doc/tagsrch.txt @ 16553:0e473e9e70c2 v8.1.1280

patch 8.1.1280: remarks about functionality not in Vi clutters the help commit https://github.com/vim/vim/commit/25c9c680ec4dfbb51f4ef21c3460a48d3c67ffc8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 5 18:13:34 2019 +0200 patch 8.1.1280: remarks about functionality not in Vi clutters the help Problem: Remarks about functionality not in Vi clutters the help. Solution: Move all info about what is new in Vim or already existed in Vi to vi_diff.txt. Remove {not in Vi} remarks. (closes #4268) Add "noet" to the help files modeline. Also include many other help file improvements.
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 May 2019 18:15:06 +0200
parents 54ffc82f38a8
children 1eaf34420bb3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
1 *tagsrch.txt* For Vim version 8.1. Last change: 2019 May 05
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 VIM REFERENCE MANUAL by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 Tags and special searches *tags-and-searches*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 See section |29.1| of the user manual for an introduction.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 1. Jump to a tag |tag-commands|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 2. Tag stack |tag-stack|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 3. Tag match list |tag-matchlist|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 4. Tags details |tag-details|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 5. Tags file format |tags-file-format|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 6. Include file searches |include-search|
16447
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
17 7. Using 'tagfunc' |tag-function|
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 1. Jump to a tag *tag-commands*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 *tag* *tags*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 A tag is an identifier that appears in a "tags" file. It is a sort of label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 that can be jumped to. For example: In C programs each function name can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 used as a tag. The "tags" file has to be generated by a program like ctags,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 before the tag commands can be used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 With the ":tag" command the cursor will be positioned on the tag. With the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 CTRL-] command, the keyword on which the cursor is standing is used as the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 tag. If the cursor is not on a keyword, the first keyword to the right of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 cursor is used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 The ":tag" command works very well for C programs. If you see a call to a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 function and wonder what that function does, position the cursor inside of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 function name and hit CTRL-]. This will bring you to the function definition.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 An easy way back is with the CTRL-T command. Also read about the tag stack
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 *:ta* *:tag* *E426* *E429*
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
40 :[count]ta[g][!] {name}
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
41 Jump to the definition of {name}, using the
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
42 information in the tags file(s). Put {name} in the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 tag stack. See |tag-!| for [!].
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
44 {name} can be a regexp pattern, see |tag-regexp|.
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
45 When there are several matching tags for {name}, jump
685
d7e33248b9c8 updated for version 7.0206
vimboss
parents: 651
diff changeset
46 to the [count] one. When [count] is omitted the
d7e33248b9c8 updated for version 7.0206
vimboss
parents: 651
diff changeset
47 first one is jumped to. See |tag-matchlist| for
d7e33248b9c8 updated for version 7.0206
vimboss
parents: 651
diff changeset
48 jumping to other matching tags.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 g<LeftMouse> *g<LeftMouse>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 <C-LeftMouse> *<C-LeftMouse>* *CTRL-]*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 CTRL-] Jump to the definition of the keyword under the
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
53 cursor. Same as ":tag {name}", where {name} is the
685
d7e33248b9c8 updated for version 7.0206
vimboss
parents: 651
diff changeset
54 keyword under or after cursor.
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
55 When there are several matching tags for {name}, jump
685
d7e33248b9c8 updated for version 7.0206
vimboss
parents: 651
diff changeset
56 to the [count] one. When no [count] is given the
d7e33248b9c8 updated for version 7.0206
vimboss
parents: 651
diff changeset
57 first one is jumped to. See |tag-matchlist| for
d7e33248b9c8 updated for version 7.0206
vimboss
parents: 651
diff changeset
58 jumping to other matching tags.
d7e33248b9c8 updated for version 7.0206
vimboss
parents: 651
diff changeset
59 {Vi: identifier after the cursor}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 *v_CTRL-]*
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
62 {Visual}CTRL-] Same as ":tag {name}", where {name} is the text that
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
63 is highlighted.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 *telnet-CTRL-]*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 CTRL-] is the default telnet escape key. When you type CTRL-] to jump to a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 tag, you will get the telnet prompt instead. Most versions of telnet allow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 changing or disabling the default escape key. See the telnet man page. You
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 can 'telnet -E {Hostname}' to disable the escape character, or 'telnet -e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 {EscapeCharacter} {Hostname}' to specify another escape character. If
56
dbf53ece2e23 updated for version 7.0029
vimboss
parents: 20
diff changeset
71 possible, try to use "ssh" instead of "telnet" to avoid this problem.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 *tag-priority*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 When there are multiple matches for a tag, this priority is used:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 1. "FSC" A full matching static tag for the current file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 2. "F C" A full matching global tag for the current file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 3. "F " A full matching global tag for another file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 4. "FS " A full matching static tag for another file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 5. " SC" An ignore-case matching static tag for the current file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 6. " C" An ignore-case matching global tag for the current file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 7. " " An ignore-case matching global tag for another file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 8. " S " An ignore-case matching static tag for another file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 Note that when the current file changes, the priority list is mostly not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 changed, to avoid confusion when using ":tnext". It is changed when using
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
86 ":tag {name}".
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
9913
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
88 The ignore-case matches are not found for a ":tag" command when:
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
89 - the 'ignorecase' option is off and 'tagcase' is "followic"
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
90 - 'tagcase' is "match"
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
91 - 'tagcase' is "smart" and the pattern contains an upper case character.
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
92 - 'tagcase' is "followscs" and 'smartcase' option is on and the pattern
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
93 contains an upper case character.
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
94
10218
584c835a2de1 commit https://github.com/vim/vim/commit/50ba526fbf3e9e5e0e6b0b3086a4d5df581ebc7e
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
95 The ignore-case matches are found when:
9913
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
96 - a pattern is used (starting with a "/")
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
97 - for ":tselect"
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
98 - when 'tagcase' is "followic" and 'ignorecase' is off
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
99 - when 'tagcase' is "match"
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
100 - when 'tagcase' is "followscs" and the 'smartcase' option is off
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
101
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
102 Note that using ignore-case tag searching disables binary searching in the
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
103 tags file, which causes a slowdown. This can be avoided by fold-case sorting
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
104 the tag file. See the 'tagbsearch' option for an explanation.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 2. Tag stack *tag-stack* *tagstack* *E425*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 On the tag stack is remembered which tags you jumped to, and from where.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 Tags are only pushed onto the stack when the 'tagstack' option is set.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 g<RightMouse> *g<RightMouse>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 <C-RightMouse> *<C-RightMouse>* *CTRL-T*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 CTRL-T Jump to [count] older entry in the tag stack
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
115 (default 1).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 *:po* *:pop* *E555* *E556*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 :[count]po[p][!] Jump to [count] older entry in tag stack (default 1).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
119 See |tag-!| for [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 :[count]ta[g][!] Jump to [count] newer entry in tag stack (default 1).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
122 See |tag-!| for [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 *:tags*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 :tags Show the contents of the tag stack. The active
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
126 entry is marked with a '>'.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 The output of ":tags" looks like this:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
130 # TO tag FROM line in file/text
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 1 1 main 1 harddisk2:text/vim/test
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 > 2 2 FuncA 58 i = FuncA(10);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 3 1 FuncC 357 harddisk2:text/vim/src/amiga.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 This list shows the tags that you jumped to and the cursor position before
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 that jump. The older tags are at the top, the newer at the bottom.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 The '>' points to the active entry. This is the tag that will be used by the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 next ":tag" command. The CTRL-T and ":pop" command will use the position
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 above the active entry.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 Below the "TO" is the number of the current match in the match list. Note
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 that this doesn't change when using ":pop" or ":tag".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 The line number and file name are remembered to be able to get back to where
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 you were before the tag command. The line number will be correct, also when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 deleting/inserting lines, unless this was done by another program (e.g.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 another instance of Vim).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
150 For the current file, the "file/text" column shows the text at the position.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 An indent is removed and a long line is truncated to fit in the window.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 You can jump to previously used tags with several commands. Some examples:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 ":pop" or CTRL-T to position before previous tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 {count}CTRL-T to position before {count} older tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 ":tag" to newer tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 ":0tag" to last used tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 The most obvious way to use this is while browsing through the call graph of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 a program. Consider the following call graph:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 main ---> FuncA ---> FuncC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 ---> FuncB
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 (Explanation: main calls FuncA and FuncB; FuncA calls FuncC).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 You can get from main to FuncA by using CTRL-] on the call to FuncA. Then
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 you can CTRL-] to get to FuncC. If you now want to go back to main you can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 use CTRL-T twice. Then you can CTRL-] to FuncB.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
171 If you issue a ":ta {name}" or CTRL-] command, this tag is inserted at the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 current position in the stack. If the stack was full (it can hold up to 20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 entries), the oldest entry is deleted and the older entries shift one
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 position up (their index number is decremented by one). If the last used
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 entry was not at the bottom, the entries below the last used one are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 deleted. This means that an old branch in the call graph is lost. After the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 commands explained above the tag stack will look like this:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
179 # TO tag FROM line in file/text
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
180 1 1 main 1 harddisk2:text/vim/test
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
181 2 1 FuncB 59 harddisk2:text/vim/src/main.c
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182
15033
f8b0f1e42f2c Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15016
diff changeset
183 The |gettagstack()| function returns the tag stack of a specified window. The
f8b0f1e42f2c Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15016
diff changeset
184 |settagstack()| function modifies the tag stack of a window.
15016
c338c91086b9 patch 8.1.0519: cannot save and restore the tag stack
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
185
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 *E73*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 When you try to use the tag stack while it doesn't contain anything you will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 get an error message.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 3. Tag match list *tag-matchlist* *E427* *E428*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 When there are several matching tags, these commands can be used to jump
2033
de5a43c5eedc Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
194 between them. Note that these commands don't change the tag stack, they keep
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 the same entry.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 *:ts* *:tselect*
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
198 :ts[elect][!] [name] List the tags that match [name], using the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 information in the tags file(s).
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
200 When [name] is not given, the last tag name from the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 tag stack is used.
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10218
diff changeset
202 See |tag-!| for [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 With a '>' in the first column is indicated which is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 the current position in the list (if there is one).
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
205 [name] can be a regexp pattern, see |tag-regexp|.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 See |tag-priority| for the priorities used in the
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
207 listing.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 Example output:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 nr pri kind tag file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 1 F f mch_delay os_amiga.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 mch_delay(msec, ignoreinput)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 > 2 F f mch_delay os_msdos.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 mch_delay(msec, ignoreinput)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 3 F f mch_delay os_unix.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 mch_delay(msec, ignoreinput)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 Enter nr of choice (<CR> to abort):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 See |tag-priority| for the "pri" column. Note that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 this depends on the current file, thus using
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 ":tselect xxx" can produce different results.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 The "kind" column gives the kind of tag, if this was
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 included in the tags file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 The "info" column shows information that could be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 found in the tags file. It depends on the program
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 that produced the tags file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 When the list is long, you may get the |more-prompt|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 If you already see the tag you want to use, you can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 type 'q' and enter the number.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 *:sts* *:stselect*
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
233 :sts[elect][!] [name] Does ":tselect[!] [name]" and splits the window for
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
234 the selected tag.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 *g]*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 g] Like CTRL-], but use ":tselect" instead of ":tag".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 *v_g]*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 {Visual}g] Same as "g]", but use the highlighted text as the
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
241 identifier.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 *:tj* *:tjump*
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
244 :tj[ump][!] [name] Like ":tselect", but jump to the tag directly when
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
245 there is only one match.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 *:stj* *:stjump*
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
248 :stj[ump][!] [name] Does ":tjump[!] [name]" and splits the window for the
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
249 selected tag.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 *g_CTRL-]*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 g CTRL-] Like CTRL-], but use ":tjump" instead of ":tag".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 *v_g_CTRL-]*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 {Visual}g CTRL-] Same as "g CTRL-]", but use the highlighted text as
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
256 the identifier.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 *:tn* *:tnext*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 :[count]tn[ext][!] Jump to [count] next matching tag (default 1). See
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
260 |tag-!| for [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 *:tp* *:tprevious*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 :[count]tp[revious][!] Jump to [count] previous matching tag (default 1).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
264 See |tag-!| for [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 *:tN* *:tNext*
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
267 :[count]tN[ext][!] Same as ":tprevious".
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 *:tr* *:trewind*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 :[count]tr[ewind][!] Jump to first matching tag. If [count] is given, jump
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
271 to [count]th matching tag. See |tag-!| for [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 *:tf* *:tfirst*
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
274 :[count]tf[irst][!] Same as ":trewind".
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 *:tl* *:tlast*
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
277 :tl[ast][!] Jump to last matching tag. See |tag-!| for [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents: 557
diff changeset
279 *:lt* *:ltag*
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
280 :lt[ag][!] [name] Jump to tag [name] and add the matching tags to a new
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
281 location list for the current window. [name] can be
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
282 a regexp pattern, see |tag-regexp|. When [name] is
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents: 557
diff changeset
283 not given, the last tag name from the tag stack is
bc95c6c4bac1 updated for version 7.0191
vimboss
parents: 557
diff changeset
284 used. The search pattern to locate the tag line is
bc95c6c4bac1 updated for version 7.0191
vimboss
parents: 557
diff changeset
285 prefixed with "\V" to escape all the special
bc95c6c4bac1 updated for version 7.0191
vimboss
parents: 557
diff changeset
286 characters (very nomagic). The location list showing
bc95c6c4bac1 updated for version 7.0191
vimboss
parents: 557
diff changeset
287 the matching tags is independent of the tag stack.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents: 557
diff changeset
288 See |tag-!| for [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 When there is no other message, Vim shows which matching tag has been jumped
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 to, and the number of matching tags: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 tag 1 of 3 or more
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 The " or more" is used to indicate that Vim didn't try all the tags files yet.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 When using ":tnext" a few times, or with ":tlast", more matches may be found.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 When you didn't see this message because of some other message, or you just
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 want to know where you are, this command will show it again (and jump to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 same tag as last time): >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 :0tn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 *tag-skip-file*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 When a matching tag is found for which the file doesn't exist, this match is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 skipped and the next matching tag is used. Vim reports this, to notify you of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 missing files. When the end of the list of matches has been reached, an error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 message is given.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents: 557
diff changeset
307 *tag-preview*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 The tag match list can also be used in the preview window. The commands are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 the same as above, with a "p" prepended.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 {not available when compiled without the |+quickfix| feature}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 *:pts* *:ptselect*
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
313 :pts[elect][!] [name] Does ":tselect[!] [name]" and shows the new tag in a
237
73354c21f1e4 updated for version 7.0066
vimboss
parents: 169
diff changeset
314 "Preview" window. See |:ptag| for more info.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 *:ptj* *:ptjump*
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12756
diff changeset
317 :ptj[ump][!] [name] Does ":tjump[!] [name]" and shows the new tag in a
237
73354c21f1e4 updated for version 7.0066
vimboss
parents: 169
diff changeset
318 "Preview" window. See |:ptag| for more info.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 *:ptn* *:ptnext*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 :[count]ptn[ext][!] ":tnext" in the preview window. See |:ptag|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 *:ptp* *:ptprevious*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 :[count]ptp[revious][!] ":tprevious" in the preview window. See |:ptag|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 *:ptN* *:ptNext*
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
327 :[count]ptN[ext][!] Same as ":ptprevious".
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 *:ptr* *:ptrewind*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 :[count]ptr[ewind][!] ":trewind" in the preview window. See |:ptag|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 *:ptf* *:ptfirst*
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
333 :[count]ptf[irst][!] Same as ":ptrewind".
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 *:ptl* *:ptlast*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 :ptl[ast][!] ":tlast" in the preview window. See |:ptag|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 4. Tags details *tag-details*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 *static-tag*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 A static tag is a tag that is defined for a specific file. In a C program
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 this could be a static function.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 In Vi jumping to a tag sets the current search pattern. This means that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 the "n" command after jumping to a tag does not search for the same pattern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 that it did before jumping to the tag. Vim does not do this as we consider it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 to be a bug. You can still find the tag search pattern in the search history.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 If you really want the old Vi behavior, set the 't' flag in 'cpoptions'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 *tag-binary-search*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 Vim uses binary searching in the tags file to find the desired tag quickly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 (when enabled at compile time |+tag_binary|). But this only works if the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 tags file was sorted on ASCII byte value. Therefore, if no match was found,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 another try is done with a linear search. If you only want the linear search,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 reset the 'tagbsearch' option. Or better: Sort the tags file!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 Note that the binary searching is disabled when not looking for a tag with a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 specific name. This happens when ignoring case and when a regular expression
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 is used that doesn't start with a fixed string. Tag searching can be a lot
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 slower then. The former can be avoided by case-fold sorting the tags file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 See 'tagbsearch' for details.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 *tag-regexp*
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5220
diff changeset
365 The ":tag" and ":tselect" commands accept a regular expression argument. See
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 |pattern| for the special characters that can be used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 When the argument starts with '/', it is used as a pattern. If the argument
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 does not start with '/', it is taken literally, as a full tag name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 Examples: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 :tag main
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 < jumps to the tag "main" that has the highest priority. >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 :tag /^get
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 < jumps to the tag that starts with "get" and has the highest priority. >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 :tag /norm
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 < lists all the tags that contain "norm", including "id_norm".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 When the argument both exists literally, and match when used as a regexp, a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 literal match has a higher priority. For example, ":tag /open" matches "open"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 before "open_file" and "file_open".
415
165c628aa9fc updated for version 7.0108
vimboss
parents: 237
diff changeset
379 When using a pattern case is ignored. If you want to match case use "\C" in
165c628aa9fc updated for version 7.0108
vimboss
parents: 237
diff changeset
380 the pattern.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 *tag-!*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 If the tag is in the current file this will always work. Otherwise the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 performed actions depend on whether the current file was changed, whether a !
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 is added to the command and on the 'autowrite' option:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 tag in file autowrite ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 current file changed ! option action ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 -----------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 yes x x x goto tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 no no x x read other file, goto tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 no yes yes x abandon current file, read other file, goto
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 no yes no on write current file, read other file, goto
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 no yes no off fail
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 -----------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 - If the tag is in the current file, the command will always work.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 - If the tag is in another file and the current file was not changed, the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 other file will be made the current file and read into the buffer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 - If the tag is in another file, the current file was changed and a ! is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 added to the command, the changes to the current file are lost, the other
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 file will be made the current file and read into the buffer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 - If the tag is in another file, the current file was changed and the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 'autowrite' option is on, the current file will be written, the other
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 file will be made the current file and read into the buffer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 - If the tag is in another file, the current file was changed and the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 'autowrite' option is off, the command will fail. If you want to save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 the changes, use the ":w" command and then use ":tag" without an argument.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 This works because the tag is put on the stack anyway. If you want to lose
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 the changes you can use the ":tag!" command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 *tag-security*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 Note that Vim forbids some commands, for security reasons. This works like
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 using the 'secure' option for exrc/vimrc files in the current directory. See
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 |trojan-horse| and |sandbox|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 When the {tagaddress} changes a buffer, you will get a warning message:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 "WARNING: tag command changed a buffer!!!"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 In a future version changing the buffer will be impossible. All this for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 security reasons: Somebody might hide a nasty command in the tags file, which
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 would otherwise go unnoticed. Example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 :$d|/tag-function-name/
237
73354c21f1e4 updated for version 7.0066
vimboss
parents: 169
diff changeset
424 {this security prevention is not present in Vi}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 In Vi the ":tag" command sets the last search pattern when the tag is searched
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 for. In Vim this is not done, the previous search pattern is still remembered,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 unless the 't' flag is present in 'cpoptions'. The search pattern is always
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 put in the search history, so you can modify it if searching fails.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 *emacs-tags* *emacs_tags* *E430*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 Emacs style tag files are only supported if Vim was compiled with the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 |+emacs_tags| feature enabled. Sorry, there is no explanation about Emacs tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 files here, it is only supported for backwards compatibility :-).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435
2033
de5a43c5eedc Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
436 Lines in Emacs tags files can be very long. Vim only deals with lines of up
de5a43c5eedc Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
437 to about 510 bytes. To see whether lines are ignored set 'verbose' to 5 or
de5a43c5eedc Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
438 higher.
de5a43c5eedc Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
439
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 *tags-option*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 The 'tags' option is a list of file names. Each of these files is searched
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 for the tag. This can be used to use a different tags file than the default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 file "tags". It can also be used to access a common tags file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 The next file in the list is not used when:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 - A matching static tag for the current buffer has been found.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 - A matching global tag has been found.
9913
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
448 This also depends on whether case is ignored. Case is ignored when:
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
449 - 'tagcase' is "followic" and 'ignorecase' is set
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
450 - 'tagcase' is "ignore"
9975
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
451 - 'tagcase' is "smart" and the pattern only contains lower case
9913
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
452 characters.
9975
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
453 - 'tagcase' is "followscs" and 'smartcase' is set and the pattern only
9913
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
454 contains lower case characters.
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
455 If case is not ignored, and the tags file only has a match without matching
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
456 case, the next tags file is searched for a match with matching case. If no
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
457 tag with matching case is found, the first match without matching case is
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
458 used. If case is ignored, and a matching global tag with or without matching
bb00c661b3a4 commit https://github.com/vim/vim/commit/66e29d7112e437b2b50efe1f82c7e892736d23e4
Christian Brabandt <cb@256bit.org>
parents: 7266
diff changeset
459 case is found, this one is used, no further tags files are searched.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 When a tag file name starts with "./", the '.' is replaced with the path of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 the current file. This makes it possible to use a tags file in the directory
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 where the current file is (no matter what the current directory is). The idea
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 of using "./" is that you can define which tag file is searched first: In the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 current directory ("tags,./tags") or in the directory of the current file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 ("./tags,tags").
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 For example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 :set tags=./tags,tags,/home/user/commontags
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 In this example the tag will first be searched for in the file "tags" in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 directory where the current file is. Next the "tags" file in the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 directory. If it is not found there, then the file "/home/user/commontags"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 will be searched for the tag.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 This can be switched off by including the 'd' flag in 'cpoptions', to make
557
862863033fdd updated for version 7.0158
vimboss
parents: 415
diff changeset
477 it Vi compatible. "./tags" will then be the tags file in the current
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 directory, instead of the tags file in the directory where the current file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 is.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 Instead of the comma a space may be used. Then a backslash is required for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 the space to be included in the string option: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 :set tags=tags\ /home/user/commontags
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 To include a space in a file name use three backslashes. To include a comma
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 in a file name use two backslashes. For example, use: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 :set tags=tag\\\ file,/home/user/common\\,tags
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 for the files "tag file" and "/home/user/common,tags". The 'tags' option will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 have the value "tag\ file,/home/user/common\,tags".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 If the 'tagrelative' option is on (which is the default) and using a tag file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 in another directory, file names in that tag file are relative to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494 directory where the tag file is.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 5. Tags file format *tags-file-format* *E431*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499 *ctags* *jtags*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 A tags file can be created with an external command, for example "ctags". It
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 will contain a tag for each function. Some versions of "ctags" will also make
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 a tag for each "#defined" macro, typedefs, enums, etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 Some programs that generate tags files:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 ctags As found on most Unix systems. Only supports C. Only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 does the basic work.
20
4ac1dce8dd5e updated for version 7.0012
vimboss
parents: 7
diff changeset
507 *Exuberant_ctags*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 exuberant ctags This a very good one. It works for C, C++, Java,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 Fortran, Eiffel and others. It can generate tags for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 many items. See http://ctags.sourceforge.net.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 etags Connected to Emacs. Supports many languages.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 JTags For Java, in Java. It can be found at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513 http://www.fleiner.com/jtags/.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 ptags.py For Python, in Python. Found in your Python source
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 directory at Tools/scripts/ptags.py.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 ptags For Perl, in Perl. It can be found at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 http://www.eleves.ens.fr:8080/home/nthiery/Tags/.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518 gnatxref For Ada. See http://www.gnuada.org/. gnatxref is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 part of the gnat package.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521
16176
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
522 The lines in the tags file must have one of these two formats:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 1. {tagname} {TAB} {tagfile} {TAB} {tagaddress}
16176
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
525 2. {tagname} {TAB} {tagfile} {TAB} {tagaddress} {term} {field} ..
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
526
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
527 Previously an old format was supported, see |tag-old-static|.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528
16176
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
529 The first format is a normal tag, which is completely compatible with Vi. It
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
530 is the only format produced by traditional ctags implementations. This is
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
531 often used for functions that are global, also referenced in other files.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533 The lines in the tags file can end in <LF> or <CR><LF>. On the Macintosh <CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 also works. The <CR> and <NL> characters can never appear inside a line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535
16176
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
536 The second format is new. It includes additional information in optional
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 fields at the end of each line. It is backwards compatible with Vi. It is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 only supported by new versions of ctags (such as Exuberant ctags).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 {tagname} The identifier. Normally the name of a function, but it can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 be any identifier. It cannot contain a <Tab>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 {TAB} One <Tab> character. Note: previous versions allowed any
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543 white space here. This has been abandoned to allow spaces in
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16023
diff changeset
544 {tagfile}.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 {tagfile} The file that contains the definition of {tagname}. It can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546 have an absolute or relative path. It may contain environment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 variables and wildcards (although the use of wildcards is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 doubtful). It cannot contain a <Tab>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549 {tagaddress} The Ex command that positions the cursor on the tag. It can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550 be any Ex command, although restrictions apply (see
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 |tag-security|). Posix only allows line numbers and search
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 commands, which are mostly used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553 {term} ;" The two characters semicolon and double quote. This is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 interpreted by Vi as the start of a comment, which makes the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 following be ignored. This is for backwards compatibility
15808
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
556 with Vi, it ignores the following fields. Example:
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
557 APP file /^static int APP;$/;" v
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
558 When {tagaddress} is not a line number or search pattern, then
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
559 {term} must be |;". Here the bar ends the command (excluding
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
560 the bar) and ;" is used to have Vi ignore the rest of the
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
561 line. Example:
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
562 APP file.c call cursor(3, 4)|;" v
16023
dc766e1b0c95 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
563
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 {field} .. A list of optional fields. Each field has the form:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 <Tab>{fieldname}:{value}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 The {fieldname} identifies the field, and can only contain
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569 alphabetical characters [a-zA-Z].
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 The {value} is any string, but cannot contain a <Tab>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571 These characters are special:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572 "\t" stands for a <Tab>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573 "\r" stands for a <CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574 "\n" stands for a <NL>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 "\\" stands for a single '\' character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577 There is one field that doesn't have a ':'. This is the kind
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 of the tag. It is handled like it was preceded with "kind:".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579 See the documentation of ctags for the kinds it produces.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581 The only other field currently recognized by Vim is "file:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 (with an empty value). It is used for a static tag.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583
16176
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
584
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 The first lines in the tags file can contain lines that start with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586 !_TAG_
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 These are sorted to the first lines, only rare tags that start with "!" can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 sort to before them. Vim recognizes two items. The first one is the line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 that indicates if the file was sorted. When this line is found, Vim uses
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 binary searching for the tags file:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 !_TAG_FILE_SORTED<Tab>1<Tab>{anything} ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592
7266
6ba7182fb7bd commit https://github.com/vim/vim/commit/0f6562e9036f889185dff49a75c7fc5ffb28b307
Christian Brabandt <cb@256bit.org>
parents: 5400
diff changeset
593 A tag file may be case-fold sorted to avoid a linear search when case is
6ba7182fb7bd commit https://github.com/vim/vim/commit/0f6562e9036f889185dff49a75c7fc5ffb28b307
Christian Brabandt <cb@256bit.org>
parents: 5400
diff changeset
594 ignored. (Case is ignored when 'ignorecase' is set and 'tagcase' is
6ba7182fb7bd commit https://github.com/vim/vim/commit/0f6562e9036f889185dff49a75c7fc5ffb28b307
Christian Brabandt <cb@256bit.org>
parents: 5400
diff changeset
595 "followic", or when 'tagcase' is "ignore".) See 'tagbsearch' for details.
6ba7182fb7bd commit https://github.com/vim/vim/commit/0f6562e9036f889185dff49a75c7fc5ffb28b307
Christian Brabandt <cb@256bit.org>
parents: 5400
diff changeset
596 The value '2' should be used then:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 !_TAG_FILE_SORTED<Tab>2<Tab>{anything} ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598
15878
314694a2e74a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
599 The other tag that Vim recognizes is the encoding of the tags file:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 !_TAG_FILE_ENCODING<Tab>utf-8<Tab>{anything} ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601 Here "utf-8" is the encoding used for the tags. Vim will then convert the tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 being searched for from 'encoding' to the encoding of the tags file. And when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603 listing tags the reverse happens. When the conversion fails the unconverted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 tag is used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606 *tag-search*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
607 The command can be any Ex command, but often it is a search command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 Examples:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609 tag1 file1 /^main(argc, argv)/ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 tag2 file2 108 ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 The command is always executed with 'magic' not set. The only special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 characters in a search pattern are "^" (begin-of-line) and "$" (<EOL>).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614 See |pattern|. Note that you must put a backslash before each backslash in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615 the search text. This is for backwards compatibility with Vi.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617 *E434* *E435*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618 If the command is a normal search command (it starts and ends with "/" or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619 "?"), some special handling is done:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 - Searching starts on line 1 of the file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621 The direction of the search is forward for "/", backward for "?".
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
622 Note that 'wrapscan' does not matter, the whole file is always searched.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623 - If the search fails, another try is done ignoring case. If that fails too,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624 a search is done for:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625 "^tagname[ \t]*("
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626 (the tag with '^' prepended and "[ \t]*(" appended). When using function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627 names, this will find the function name when it is in column 0. This will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 help when the arguments to the function have changed since the tags file was
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 made. If this search also fails another search is done with:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630 "^[#a-zA-Z_].*\<tagname[ \t]*("
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 This means: A line starting with '#' or an identifier and containing the tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 followed by white space and a '('. This will find macro names and function
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
633 names with a type prepended.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634
16176
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
635
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
636 *tag-old-static*
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
637 Until March 2019 (patch 8.1.1092) an outdated format was supported:
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
638 {tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress}
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
639
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
640 This format is for a static tag only. It is obsolete now, replaced by
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
641 the second format. It is only supported by Elvis 1.x, older Vim versions and
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
642 a few versions of ctags. A static tag is often used for functions that are
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
643 local, only referenced in the file {tagfile}. Note that for the static tag,
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
644 the two occurrences of {tagfile} must be exactly the same. Also see
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
645 |tags-option| below, for how static tags are used.
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
646
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
647 The support was removed, since when you can update to the new Vim version you
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
648 should also be able to update ctags to one that supports the second format.
4d7ee5609652 patch 8.1.1093: support for outdated tags format slows down tag parsing
Bram Moolenaar <Bram@vim.org>
parents: 16086
diff changeset
649
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 6. Include file searches *include-search* *definition-search*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 *E387* *E388* *E389*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 These commands look for a string in the current file and in all encountered
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655 included files (recursively). This can be used to find the definition of a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 variable, function or macro. If you only want to search in the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 buffer, use the commands listed at |pattern-searches|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 These commands are not available when the |+find_in_path| feature was disabled
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 at compile time.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662 When a line is encountered that includes another file, that file is searched
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 before continuing in the current buffer. Files included by included files are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 also searched. When an include file could not be found it is silently
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 ignored. Use the |:checkpath| command to discover which files could not be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666 found, possibly your 'path' option is not set up correctly. Note: the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 included file is searched, not a buffer that may be editing that file. Only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668 for the current file the lines in the buffer are used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 The string can be any keyword or a defined macro. For the keyword any match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 will be found. For defined macros only lines that match with the 'define'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672 option will be found. The default is "^#\s*define", which is for C programs.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673 For other languages you probably want to change this. See 'define' for an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 example for C++. The string cannot contain an end-of-line, only matches
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 within a line are found.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677 When a match is found for a defined macro, the displaying of lines continues
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678 with the next line when a line ends in a backslash.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680 The commands that start with "[" start searching from the start of the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681 file. The commands that start with "]" start at the current cursor position.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683 The 'include' option is used to define a line that includes another file. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684 default is "\^#\s*include", which is for C programs. Note: Vim does not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685 recognize C syntax, if the 'include' option matches a line inside
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 "#ifdef/#endif" or inside a comment, it is searched anyway. The 'isfname'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 option is used to recognize the file name that comes after the matched
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688 pattern.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 The 'path' option is used to find the directory for the include files that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691 do not have an absolute path.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693 The 'comments' option is used for the commands that display a single line or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694 jump to a line. It defines patterns that may start a comment. Those lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695 are ignored for the search, unless [!] is used. One exception: When the line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 matches the pattern "^# *define" it is not considered to be a comment.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 If you want to list matches, and then select one to jump to, you could use a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699 mapping to do that for you. Here is an example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 :map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703 *[i*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704 [i Display the first line that contains the keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705 under the cursor. The search starts at the beginning
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706 of the file. Lines that look like a comment are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 ignored (see 'comments' option). If a count is given,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708 the count'th matching line is displayed, and comment
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
709 lines are not ignored.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 *]i*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712 ]i like "[i", but start at the current cursor position.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714 *:is* *:isearch*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715 :[range]is[earch][!] [count] [/]pattern[/]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 Like "[i" and "]i", but search in [range] lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717 (default: whole file).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
718 See |:search-args| for [/] and [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720 *[I*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
721 [I Display all lines that contain the keyword under the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722 cursor. Filenames and line numbers are displayed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723 for the found lines. The search starts at the
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
724 beginning of the file.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726 *]I*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 ]I like "[I", but start at the current cursor position.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729 *:il* *:ilist*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 :[range]il[ist][!] [/]pattern[/]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731 Like "[I" and "]I", but search in [range] lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 (default: whole file).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
733 See |:search-args| for [/] and [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735 *[_CTRL-I*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 [ CTRL-I Jump to the first line that contains the keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737 under the cursor. The search starts at the beginning
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738 of the file. Lines that look like a comment are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 ignored (see 'comments' option). If a count is given,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740 the count'th matching line is jumped to, and comment
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
741 lines are not ignored.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 *]_CTRL-I*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744 ] CTRL-I like "[ CTRL-I", but start at the current cursor
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
745 position.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 *:ij* *:ijump*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748 :[range]ij[ump][!] [count] [/]pattern[/]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 Like "[ CTRL-I" and "] CTRL-I", but search in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750 [range] lines (default: whole file).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
751 See |:search-args| for [/] and [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 CTRL-W CTRL-I *CTRL-W_CTRL-I* *CTRL-W_i*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754 CTRL-W i Open a new window, with the cursor on the first line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 that contains the keyword under the cursor. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756 search starts at the beginning of the file. Lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757 that look like a comment line are ignored (see
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758 'comments' option). If a count is given, the count'th
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 matching line is jumped to, and comment lines are not
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
760 ignored.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762 *:isp* *:isplit*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 :[range]isp[lit][!] [count] [/]pattern[/]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764 Like "CTRL-W i" and "CTRL-W i", but search in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 [range] lines (default: whole file).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
766 See |:search-args| for [/] and [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768 *[d*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769 [d Display the first macro definition that contains the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770 macro under the cursor. The search starts from the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 beginning of the file. If a count is given, the
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
772 count'th matching line is displayed.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774 *]d*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775 ]d like "[d", but start at the current cursor position.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777 *:ds* *:dsearch*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 :[range]ds[earch][!] [count] [/]string[/]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779 Like "[d" and "]d", but search in [range] lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780 (default: whole file).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
781 See |:search-args| for [/] and [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 *[D*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784 [D Display all macro definitions that contain the macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
785 under the cursor. Filenames and line numbers are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786 displayed for the found lines. The search starts
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
787 from the beginning of the file.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789 *]D*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
790 ]D like "[D", but start at the current cursor position.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
791
169
0e902b8f511f updated for version 7.0051
vimboss
parents: 56
diff changeset
792 *:dli* *:dlist*
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2681
diff changeset
793 :[range]dli[st][!] [/]string[/]
5400
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
794 Like `[D` and `]D`, but search in [range] lines
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795 (default: whole file).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
796 See |:search-args| for [/] and [!].
5400
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
797 Note that `:dl` works like `:delete` with the "l"
173c9c860e42 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
798 flag, not `:dlist`.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
799
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800 *[_CTRL-D*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
801 [ CTRL-D Jump to the first macro definition that contains the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 keyword under the cursor. The search starts from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
803 the beginning of the file. If a count is given, the
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
804 count'th matching line is jumped to.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806 *]_CTRL-D*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807 ] CTRL-D like "[ CTRL-D", but start at the current cursor
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
808 position.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
809
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
810 *:dj* *:djump*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811 :[range]dj[ump][!] [count] [/]string[/]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812 Like "[ CTRL-D" and "] CTRL-D", but search in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
813 [range] lines (default: whole file).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
814 See |:search-args| for [/] and [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
815
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
816 CTRL-W CTRL-D *CTRL-W_CTRL-D* *CTRL-W_d*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
817 CTRL-W d Open a new window, with the cursor on the first
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
818 macro definition line that contains the keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
819 under the cursor. The search starts from the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
820 beginning of the file. If a count is given, the
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
821 count'th matching line is jumped to.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
822
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
823 *:dsp* *:dsplit*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
824 :[range]dsp[lit][!] [count] [/]string[/]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
825 Like "CTRL-W d", but search in [range] lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
826 (default: whole file).
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
827 See |:search-args| for [/] and [!].
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
828
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
829 *:che* *:checkpath*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
830 :che[ckpath] List all the included files that could not be found.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831
16553
0e473e9e70c2 patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents: 16447
diff changeset
832 :che[ckpath]! List all the included files.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
834 *:search-args*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
835 Common arguments for the commands above:
9975
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
836 [!] When included, find matches in lines that are recognized as comments.
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
837 When excluded, a match is ignored when the line is recognized as a
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
838 comment (according to 'comments'), or the match is in a C comment
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
839 (after "//" or inside /* */). Note that a match may be missed if a
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
840 line is recognized as a comment, but the comment ends halfway the line.
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
841 And if the line is a comment, but it is not recognized (according to
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
842 'comments') a match may be found in it anyway. Example: >
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843 /* comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
844 foobar */
9975
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
845 < A match for "foobar" is found, because this line is not recognized as
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
846 a comment (even though syntax highlighting does recognize it).
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
847 Note: Since a macro definition mostly doesn't look like a comment, the
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
848 [!] makes no difference for ":dlist", ":dsearch" and ":djump".
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
849 [/] A pattern can be surrounded by '/'. Without '/' only whole words are
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
850 matched, using the pattern "\<pattern\>". Only after the second '/' a
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
851 next command can be appended with '|'. Example: >
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
852 :isearch /string/ | echo "the last one"
9975
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
853 < For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 9913
diff changeset
854 is used as a literal string, not as a search pattern.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
855
16447
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
856 ==============================================================================
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
857 7. Using 'tagfunc' *tag-function*
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
858
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
859 It is possible to provide Vim with a function which will generate a list of
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
860 tags used for commands like |:tag|, |:tselect| and Normal mode tag commands
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
861 like |CTRL-]|.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
862
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
863 The function used for generating the taglist is specified by setting the
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
864 'tagfunc' option. The function will be called with three arguments:
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
865 a:pattern The tag identifier used during the tag search.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
866 a:flags List of flags to control the function behavior.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
867 a:info Dict containing the following entries:
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
868 buf_ffname Full filename which can be used for priority.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
869 user_data Custom data String, if stored in the tag
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
870 stack previously by tagfunc.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
871
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
872 Currently two flags may be passed to the tag function:
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
873 'c' The function was invoked by a normal command being processed
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
874 (mnemonic: the tag function may use the context around the
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
875 cursor to perform a better job of generating the tag list.)
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
876 'i' In Insert mode, the user was completing a tag (with
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
877 |i_CTRL-X_CTRL-]|).
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
878
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
879 Note that when 'tagfunc' is set, the priority of the tags described in
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
880 |tag-priority| does not apply. Instead, the priority is exactly as the
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
881 ordering of the elements in the list returned by the function.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
882 *E987*
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
883 The function should return a List of Dict entries. Each Dict must at least
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
884 include the following entries and each value must be a string:
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
885 name Name of the tag.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
886 filename Name of the file where the tag is defined. It is
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
887 either relative to the current directory or a full path.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
888 cmd Ex command used to locate the tag in the file. This
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
889 can be either an Ex search pattern or a line number.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
890 Note that the format is similar to that of |taglist()|, which makes it possible
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
891 to use its output to generate the result.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
892 The following fields are optional:
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
893 kind Type of the tag.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
894 user_data String of custom data stored in the tag stack which
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
895 can be used to disambiguate tags between operations.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
896
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
897 If the function returns |v:null| instead of a List, a standard tag lookup will
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
898 be performed instead.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
899
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
900 It is not allowed to change the tagstack from inside 'tagfunc'. *E986*
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
901
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
902 The following is a hypothetical example of a function used for 'tagfunc'. It
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
903 uses the output of |taglist()| to generate the result: a list of tags in the
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
904 inverse order of file names.
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
905 >
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
906 function! TagFunc(pattern, flags, info)
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
907 function! CompareFilenames(item1, item2)
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
908 let f1 = a:item1['filename']
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
909 let f2 = a:item2['filename']
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
910 return f1 >=# f2 ?
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
911 \ -1 : f1 <=# f2 ? 1 : 0
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
912 endfunction
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
913
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
914 let result = taglist(a:pattern)
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
915 call sort(result, "CompareFilenames")
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
916
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
917 return result
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
918 endfunc
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
919 set tagfunc=TagFunc
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
920 <
54ffc82f38a8 patch 8.1.1228: not possible to process tags with a function
Bram Moolenaar <Bram@vim.org>
parents: 16176
diff changeset
921
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
922 vim:tw=78:ts=8:noet:ft=help:norl: