Vim Plugin: Taglist

vimHi all. Inspired by catonmat, I am staring a series of article about useful Vim plugins.The first post in this series will be about a plugins called “taglist.vim“.

Here is what the home page of Taglist Plugin says:

The “Tag List” plugin is a source code browser for the Vim editor. It provides an overview of the structure of source code files and allows you to efficiently browse through source code files in different programming languages. It is the top-rated and most-downloaded plugin for the Vim editor.

The taglist plugin groups and displays the functions, classes, structures, enumerations, macro definitions and other parts of a source code file in a Vim window. The taglist plugin will automatically highlight the current tag. You can jump to the definition of a tag by selecting the tag name from the taglist window. For a list of features supported by the taglist plugin, visit the features page.

The taglist plugin requires Vim version 6.0 and above. The taglist plugin will work on all the platforms where the exuberant ctags utility and Vim are supported (this includes MS-Windows).

Install exuberant ctags in Debian based distributions using apt.

$ sudo apt-get install exuberant-ctags

Now download the latest Taglist plugin from here. Unzip the files to the $HOME/.vim or the $HOME/vimfiles or the $VIM/vimfiles directory. After this step, you should have the following two files (the directory structure should be preserved):

plugin/taglist.vim – main taglist plugin file
doc/taglist.txt    – documentation (help) file

Change to the directory containing taglist.txt. Start Vim and run the “:helptags .” command to process the taglist help file. Restart Vim. You can now use the “:TlistToggle” command to open/close the taglist  window. Use ‘Ctrl+w w’ to toggle between Taglist window and source code window. You can use the “:help taglist” command to get more information about using the taglist plugin.


Taglist ScreenShot

For more information got to Taglist project page.


Todd December 22, 2009

I use Taglist as well, but my question is if you know how to have either the class or variable sections collapsed by default?

segfault December 23, 2009

I am sorry I dont know how to do that. But you can automatically close the tags tree for inactive files by setting the Tlist_File_Fold_Auto_Close variable.