开发者

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

开发者 https://www.devze.com 2023-01-09 12:33 出处:网络
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\'

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 l开发者_开发知识库anguage agnostic way or a Ruby/Rails specific way works.


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消