Tags Base is the result of the merge of the TagsMenu script and the ctags script.
Tags Base generates a tags file for the currently edited file, refreshes it if the file is newer than the tags file and uses it to provide a set of smart feature to vim. Right now the feature provided are those of the original scripts merged in one: detection of the currently edited function (or more precisely of the last tag above the current line) and creation of a menu of tags in the file
A tag can be one of many things. This list includes (but is not limited to): classes, functions, methods, attributes, fields, variables, includes, and interfaces. Tags Menu shows all tags supported by ctags. (For the full list of supported attributes, see Exuberant CTags.)
Ok. Here's the short list:
As they say, a picture is worth a thousand words, so here's about 2000. The following are two screenshots. Those are reused fromt the description of TagsMenu
TagsBase for GVim has only two requirements: gvim 6.x, and Exuberant Ctags 5.0. ctags is not distributed with vim anymore but its a great tool for any programmer using vim.
Note 1: if you do not have version 5.0 of ctags, I recommend that you upgrade, it may work but it is not tested.
Note 2: the requirement is for Exuberant ctags. This satisfies the requirements of the
--fields=Kn
need which gives the level two formats for the tag information. Other ctags program may provide it but you'll need to tweak the parsing regexps
Installation is very simple. Place the script in a plugin directory in your runtime path.
There are several options (actually global variables) that users can modify to change the
scripts behaviour. In order to set an option, simply type
let <option-name>=<option-value>
on the line
below where you sourced the script, or :let
<option-name>=<option-value>
directly within
GVim.
Option | Default Value | Description |
---|---|---|
g:TagsBase_groupByType | 1 (true) | If true, then each tag is grouped together by it's type, and
sub-menus are created for each type of tag. If false, then no grouping is performed, and all tags are in one menu. |
g:TagsBase_useAutoCommand | 1 (true) | If true, then auto commands are set up such that every time a
buffer is loaded, who's filetype is one of the ones recognized by
ctags, then the Tags Menu is created. If false, then no auto commands are setup. In this case, it is up to the user for force tag menu regeneration. |
g:TagsBase_ctagsCommand | ctags --fields=Kn -o |
This is the actual command that the script uses to get tag information (note that the tag filename and the current filename is added to the end of this). Be aware that if you change this you'll probably need to change the g:TagsBase_ctagsPattern regexp and associated g:TagsBase_namePar, g:TagsBase_exprPar and g:TagsBase_linePar options |
g:TagsBase_debug | 0 (false) | If true, then this option produces copious amounts of information on the screen, plus leaves the temporary buffer open, as the script is run. |
g:TagsBase_Pattern | '^\([^\t]\{-}\)\t[^\t]\{-}\t\(.\{-}\);"\t\([^\t]*\)\tline:\(\d*\).*$' |
This is the regexp used to interpret the value of a Tag Be aware that if you change this you'll probably need to change the g:TagsBase_namePar, g:TagsBase_exprPar, g:TagsBase_typePar and g:TagsBase_linePar options |
g:TagsBase_namePar, g:TagsBase_exprPar, g:TagsBase_typePar and g:TagsBase_linePar | \1, \2, \3, \4 | the substitution string to use in conjunction with g:TagsBase_ctagsPattern to extract diverse parts of the tag. |
You can either browse the source code, or you can download the script.
No known problems anymore, please signal any bug you find.
tags
vim option).[02-Oct-2001] 0.4 | (vim 6.0) | "Added help, made the customization easier." | ||
[02-Oct-2001] 0.4 | (vim 6.0) | "reorganized and commented the script, support for the builtin tags stack, support for ordered tag file generation, some bugs corrected." | ||
[01-Oct-2001] 0.3 | (vim 6.0) | "added a menu entry to toggle on and off the title string functionality" | ||
[01-Oct-2001] 0.2 | (vim 6.0) | "Corrected dependency on a $TMP variable
corrected bug when on an ms system the shell used was a unix type shell, this generated problems due to the shell misinterpreting the '' in a path. If you find any other bugs, please report it by mail to me (benoit.cerrina@writeme.com" |
||
[30-Sep-2001] 0.1 | (vim 6.0) | Download | Benoit Cerrina | "Initial upload" |
Author | Benoit Cerrina |
Benoit.Cerrina@writeme.com | |
Web Page | http://benoitcerrina.dnsalias.org/TagsBase.html |
Version | Tags Base for GVim version 0.5 |
Copyright | due to the large portions of TagsMenu which were included, this script is covered by the GNU General Protection License (GPL). |