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 '16 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 '16 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 '16 at 13:13

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, privacy policy and cookie policy

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