-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathvim-tags.txt
236 lines (147 loc) · 7.78 KB
/
vim-tags.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
*vim-tags.txt* For Vim version 7.3 Last change: 2014-07-26
*vim-tags*
Vim-Tags version 0.1.0~
The Ctags generator for Vim~
Copyright (c) 2012-2014 Szymon Wrozynski and Contributors
============================================================================
Table of Contents
1. About..................................................|vim-tags-about|
2. Usage..................................................|vim-tags-usage|
3. Configuration..................................|vim-tags-configuration|
4. Author and License............................|vim-tags-author-license|
----------------------------------------------------------------------------
1. About *vim-tags-about*
Ctags support is a great feature of Vim. One approach to make use of Ctags is
the way of Tim Pope's plugins. For example in Rails projects, Ctags are
generated automatically while Bundler is running and installing new gems.
Vim-Tags plugin treats Ctags like more tightly coupled within a concrete
project. It creates '.tags' files directly in the root project directory. Also,
it can perform tags creation upon each file save through forking - available
under Unix-like operating systems. This option, however, may require some
tweaking under Windows.
Vim-Tags is under active development. Currently, besides its main features, it
provides some support for Ruby/Rails projects (it can generate tags for gems
listed in 'Gemfile.lock' file).
----------------------------------------------------------------------------
2. Usage *vim-tags-usage*
The plugin has only one command and a few options described in the
|vim-tags-configuration| section: >
:TagsGenerate
<This command will generate one or more tags files but only if the main tags file
exists. The presence of that file acts as an indicator actually. By the _main
tags file_ I mean the "tags" file collecting tags from all files and
subdirectories of the project root directory.
Moreover, this command will also update the `tags` setting of Vim with all new
tags files found in the project root as Vim-Tags caches relative tags paths and
updates `tags` settings automatically.
By default, this command is also executed upon each file save.
Besides the main "tags" file the project may have more tags files for different
directories and a special `Gemfile.lock.tags` file for tags gathered from
a Bundler project.
For the first time, when there are no `tags` files in your project yet, you can
force generating them by the `bang` version of the `:TagsGenerate` command:
:TagsGenerate!
The `bang` version of the command forces generation for all "tags" files.
Additionally, you can exclude some directories from the main "tags" file,
especially if they contains rarely changed and heavy content, i.e. third-party
libraries. Those directories must be placed directly at the project root.
To exclude them, make empty files named exactly after those directories with
".tags" suffixes: e.g. "vendor.tags" for the "vendor" directory. Then, the
plugin will be watching modification times of those directories and
corresponding tags files and perform tags generation only if necessary.
Vim-Tags can read files containing patterns to exclude from tags generation. By
default it seeks among '.gitignore', '.svnignore', and '.cvsignore' files in the
current directory. You can change this behavior by setting proper configuration
options explained later.
The last but not least feature is the Ruby Bundler support. It is easy and
straightforward. If your project root contains "Gemfile.lock" file, the plugin
will be generating tags for all your Bundler gems referenced in the Gemfile.
Here, "Gemfile.lock" modification time will be taken to find out whether the
tags generation is required, just like in the custom directories case explained
earlier. The plugin will create "Gemfile.lock.tags" file automatically
----------------------------------------------------------------------------
3. Configuration *vim-tags-configuration*
Vim-Tags assumes that you have 'ctags' utility available in your shell. However
it is possible to change or improve shell commands used by the plugin, e.g. in
case you have to point a proper binary with absolute path or tweak some options.
Vim-Tags can be configured by setting some global variables in your '.vimrc'
file. If you want to have some custom settings valid only for the current
project create a local '.vimrc' file with those settings and add the following
snippet to your main '.vimrc' file:
set exrc
set secure
This will allow Vim to use your custom .vimrc in the current working directory.
The Vim-Tags available variables are:
*vim_tags_auto_generate*
Default: `1`
If enabled, Vim-Tags will generate tags on file saving >
let g:vim_tags_auto_generate = 1
<
*vim_tags_ctags_binary*
Default: `ctags`
This is the Ctags binary which will be substitued to the commands generating
ctags files. Sometimes needs to be customized, e.g. for MacVim I had to set
it Homebrew's ctags binary: `/usr/local/bin/ctags`.
*vim_tags_project_tags_command*
Default: "{CTAGS} -R {OPTIONS} {DIRECTORY} 2>/dev/null"
This command is used for main Ctags generation. >
let g:vim_tags_project_tags_command = "({CTAGS} -R {OPTIONS} {DIRECTORY} 2>/dev/null) \&\& ({PLACE_TAGS})"
<
*vim_tags_gems_tags_command*
Default: "{CTAGS} -R {OPTIONS} `bundle show --paths` 2>/dev/null"
Command used for Gemfile tags generation. >
let g:vim_tags_gems_tags_command = "{CTAGS} -R {OPTIONS} `bundle show --paths` 2>/dev/null"
<
*vim_tags_use_vim_dispatch*
Default: `0`
`Vim-Dispatch` (https://github.com/tpope/vim-dispatch) is a plugin allowing
asynchronous calls of system commands. `Vim-Tags` will try to use it (if
found) to perform asynchronous tags generation. Otherwise `Vim-Tags` will
make asynchronous calls by adding `&` to ctags commands. >
let g:vim_tags_use_vim_dispatch = 0
<
*vim_tags_use_language_field*
Default: `1`
Use `ctags` with `--field=+l` option necessary for the tag completion in the
`YouCompleteMe` (https://github.com/Valloric/YouCompleteMe) or similar
plugins. >
let g:vim_tags_use_language_field = 1
<
*vim_tags_ignore_files*
Default: ['.gitignore', '.svnignore', '.cvsignore']
Files containing directories and files excluded from Ctags generation. >
let g:vim_tags_ignore_files = ['.gitignore', '.svnignore', '.cvsignore']
<
*vim_tags_ignore_file_comment_pattern*
Default: '^[#"]'
The pattern used to recognize comments in the ignore file. >
let g:vim_tags_ignore_file_comment_pattern = '^[#"]'
<
*vim_tags_directories*
Default: [".git", ".hg", ".svn", ".bzr", "_darcs", "CVS"]
The default directories list where the tags files will be created. The first
one found will be used. If none exists the current directory (`'.'`) will be
taken. The plugin will use that directories as root markers - indicating by
their presence the current project root directory. >
let g:vim_tags_directories = [".git", ".hg", ".svn", ".bzr", "_darcs", "CVS"]
<
*vim_tags_main_file*
Default: `'tags'`
The main tags file name. >
let g:vim_tags_main_file = 'tags'
<
*vim_tags_extension*
Default: `'.tags'`
The extension used for additional tags files. >
let g:vim_tags_extension = '.tags'
<
*vim_tags_cache_dir*
Default: `$HOME`
The directory for cache files (`.vt_location`). >
let g:vim_tags_extension = expand($HOME)
<
----------------------------------------------------------------------------
4. Author and License *vim-tags-author-license*
Vim-Tags plugin was written by Szymon Wrozynski and Contributors. It is
licensed under the same terms as Vim itself. For more info see |license|.
vim:tw=78:ts=4:ft=help:norl: