You can extend the taglist plugin to add support for new languages and also modify the support for the above listed languages.
You should NOT make modifications to the taglist plugin script file to add support for new languages. You will lose these changes when you upgrade to the next version of the taglist plugin. Instead you should follow the below described instructions to extend the taglist plugin.
You can extend the taglist plugin by setting variables in the .vimrc or _vimrc file. The name of these variables depends on the language name and is described below.
Modifying support for an existing languageTo modify the support for an already supported language, you have to set the tlist_xxx_settings variable in the ~/.vimrc or $HOME/_vimrc file. Replace xxx with the Vim filetype name for the language file.
To determine the filetype name used by Vim for a file, use the following command in the buffer containing the file:
For example, to modify the support for the perl language files, you have to set the tlist_perl_settings variable. To modify the support for java files, you have to set the tlist_java_settings variable.
The format of the value set in the tlist_xxx_settings variable is
<language_name>;flag1:name1;flag2:name2;flag3:name3The different fields in the value are separated by the ';' character.
The first field 'language_name' is the name used by exuberant ctags to refer to this language file. This name can be different from the file type name used by Vim. For example, for C++, the language name used by ctags is 'c++' but the filetype name used by Vim is 'cpp'.
The remaining fields follow the format "flag:name". The sub-field 'flag' is the language specific flag used by exuberant ctags to generate the corresponding tags. For example, for the C language, to list only the functions, the 'f' flag is used. To get the list of flags supported by exuberant ctags for the various languages use the following command:
$ ctags --list-kinds=allThe sub-field 'name' specifies the title text to use for displaying the tags of a particular type. For example, 'name' can be set to 'functions'. This field can be set to any text string name.
For example, to list only the classes and functions defined in a C++ language file, add the following line to your .vimrc file:
let tlist_cpp_settings = 'c++;c:class;f:function'In the above setting, 'cpp' is the Vim filetype name and 'c++' is the name used by the exuberant ctags tool. 'c' and 'f' are the flags passed to exuberant ctags to list C++ classes and functions and 'class' is the title used for the class tags and 'function' is the title used for the function tags in the taglist window.
For example, to display only functions defined in a C file and to use "My Functions" as the title for the function tags, use
let tlist_c_settings = 'c;f:My Functions'When you set the tlist_xxx_settings variable, you will override the default setting used by the taglist plugin for the 'xxx' language. You cannot add to the default options used by the taglist plugin for a particular file type. To add to the options used by the taglist plugin for a language, copy the option values to your .vimrc file.
Adding support for a new languageIf you want to add support for a new language to the taglist plugin, you need to first extend the exuberant ctags tool. For more information about extending exuberant ctags, visit the extending exuberant ctags page.
To add support for a new language, set the tlist_xxx_settings variable appropriately as described above. Replace 'xxx' in the variable name with the Vim filetype name for the new language.
For example, to extend the taglist plugin to support the latex language, you can use the following line (assuming, you have already extended exuberant ctags to support the latex language):
let tlist_tex_settings='latex;b:bibitem;c:command;l:label'With the above line, when you edit files of filetype "tex" in Vim, the taglist plugin will invoke the exuberant ctags tool passing the "latex" filetype and the flags b, c and l to generate the tags. The text heading 'bibitem', 'command' and 'label' will be used in the taglist window for the tags which are generated for the flags b, c and l respectively.
Language specific extensions
The extensions to exuberant ctags and the taglist plugin to support additional programming languages are listed below. These extensions are contributed by users of the taglist plugin.