Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A language-aware source code scanner (with support for git grep, ack, ag)
Branch: master
Failed to load latest commit information.
autoload trag#utils#GrepaddFiles(): Use shellescape()
doc docs
etc docs
plugin version
.gitignore misc
addon-info.json addon-info


This plugin uses ad-hoc searches to find strings in files. For certain 
languages, it can also find variable/function/class definitions, 
function calls etc.

Other than |tags| or |cscope|, it doesn't build a database to speed up 
searches but always scans all files. It can make use of external tools 
like `git grep`, `ack`, or `ag` though, in order to gain acceptable 
performance for medium-sized projects. The builtin vimscript-based 
version file scanner and also |vimgrep| are suitable for small projects. 
See |g:trag#grep_type| for available options.


First, define which files belong to your project. See 
|g:trag#file_sources| for available sources. If the variable contains 
"vcs" and the current buffer is under control of a supported VCS, trag 
will scan the files in the VCS. Maybe your project's source files are 
already registered in your tags files, in which case those will be used.

Secondly, use |:Trag| or |:Traggrep| to scan your project's files. You 
can restrict searches to certain "kinds" like only variable definitions 
or only function calls. See |trag-kinds| for details.

You can also type <Leader>r# to search for the word under cursor (see 
|g:trag_map_leader| and |TragInstallMap()| for details on maps). In 
supported filetypes, <Leader>rd will search for the definition of the 
word under cursor.

Currently the following filetypes are supported:

    - java
    - javascript
    - json
    - make
    - r
    - ruby
    - viki
    - vim

Run `:echo globpath(&rtp, 'ftplugin/*/trag.vim')` to get a full listing 
of supported filetypes.

NOTE: Some kinds are available only for a subset of known filetypes.


Status:  Works for me (there may be some minor quirks)
  tlib ::
      > git clone git://
Install: See
See for related plugins.

Something went wrong with that request. Please try again.