sponsor Vim development Vim logo Vim Book Ad

tagfinder.vim : A simple vim plugin to look for tags of specific kinds: classes, functions, etc.

 script karma  Rating 6/3, Downloaded by 1469  Comments, bugs, improvements  Vim wiki

created by
Andrew Radev
 
script type
utility
 
description
The purpose of this plugin is to enable searching for classes, functions or any
other language structures by their name. It expects a tag file generated by
using exuberant ctags. It's very similar to the built-in ":tag" command, but
with the added bonus of filtering tags by their type.

Defining a global command to look for a class by its name would look like this:

    :DefineTagFinder Class c,class

After this command is invoked, you can execute the `Class` command with a tag
name, which will send you to the class if it's unique, or load the entries in
the quickfix window and let you choose between them.

    :Class ActiveRecord

Even more conveniently, the newly defined command will have tab-completion with
the tag names, so you don't have to type it all in and you can see a useful
overview of the matching classes (or functions, modules, vim commands...).

Since different file types have different tag definitions, you can override
commands per buffer by placing `DefineLocalTagFinder` invocations in filetype
plugins, or by using autocommands:

    " in ftplugin/ruby.vim
    DefineLocalTagFinder Method f,method

    " in .vimrc
    autocommand FileType java DefineTagFinder Method m,method

Note that the plugin comes with no predefined commands at all. My personal
preference is to call them "Class", "Function" and so on, but you might prefer
to use "FindClass" and "FindFunction" instead. The plugin simply provides the
defining command. For more information on installation and usage, please take a
look at the doc file.
 
install details
There are several ways to install the plugin. The recommended one is by using
Tim Pope's pathogen (http://www.vim.org/scripts/script.php?script_id=2332). In
that case, you can clone the plugin's git repository like so:

    git clone git://github.com/AndrewRadev/tagfinder.vim.git ~/.vim/bundle/tagfinder

If your vim configuration is under git version control, you could also set up
the repository as a submodule, which would allow you to update more easily.
The command is (provided you're in ~/.vim):

    git submodule add git://github.com/AndrewRadev/tagfinder.vim.git bundle/tagfinder

Another way is to simply copy all the essential directories inside the ~.vim/
directory: autoload, doc, plugin.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
tagfinder.zip 0.1.0 2014-01-18 7.0 Andrew Radev Ability to define a tagfinder, not filtered by kind.
tagfinder.zip 0.0.1 2011-10-13 7.0 Andrew Radev Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github