Tag support in Vim

Creating a tags file

Make sure Exuberant Ctags is installed (eg. sudo yum install ctags or similar, depending on your OS).

To actually create a tags file, for Rails projects, run:

:Rtags

(requires Tim Pope's rails.vim plug-in).

Jumping to a definition

Either in command mode:

:tag foo

Or by hitting Ctrl-] over a keyword.

For cycling through matches we have:

  • :tn (next)
  • :tp (previous)
  • :tf (first)
  • :tl (last)
  • :ts (select from list)

For jumping back, Ctrl-T (or use Ctrl-I/Ctrl-O to move through the :jump list).

Show all tags

:tags