I have a bunch of includes at the top of my file.

Then I use methods from the helpers throughout my file.

How can I have it so that when my cursor is on a method name my editor can (by some keystrokes) opens up that file and go to the method definition?

  • 1
    Check out ctags.sourceforge.net and :h tags.
    – Tumbler41
    May 6, 2016 at 22:53
  • You can't. Not 100% reliably anyway. Ruby is very dynamic, and Rails make quite a lot of use of that e.g. by defining methods with CLASS_EVAL and such, rather than just def foo... Jul 7, 2016 at 12:19
  • 1
    ctags has been forked. The new maintained project is universal ctags. For some languages it really makes the difference. Dec 4, 2016 at 13:13

2 Answers 2


Use either [d or [i.

:help include-search is a built-in but sadly overlooked feature.


Have you tried using gf?

You may want to have a look at installing rails-vim if you haven't already. http://vimawesome.com/plugin/rails-vim

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.