Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim/macvim: locate where a method/symbol is defined

I'm using macvim/vim for most of my Ruby + Ruby on Rails development. Is there currently a way to jump to where a method was defined within a project, even if it's not in the same file as where it's being invoked? Either a language agnostic way or a Ruby/Rails specific way works.

like image 344
randombits Avatar asked Jul 28 '10 19:07

randombits


1 Answers

I recommend using the ctags plugin, Bryan Liles put together a nice screencast on how to use it with rails development.

http://smartic.us/2009/04/05/using-ctags-in-vim/

From his page:

Not-so-complete cheat sheet:

^] – find a tag

^T – go backwards

:tags – show where you’ve been

:tag – go somewhere in your tag stack

:tselect or g] – show where something is referenced

^W-] – find a tag in a split window

You can also have a look at the vim help by running: help :tags

EDIT:

Here is a nice screencast on updating your tags file automatically http://smartic.us/2009/04/03/creating-ctags-with-git-hooks/

like image 166
Geoff Lanotte Avatar answered Oct 31 '22 06:10

Geoff Lanotte