There are no perfect solutions in Vim, but you can come close to cscope and grep or ack .
cscope helps you find all references to a character. It was created for the C and C languages, but it also does a decent job of matching characters in Ruby code. He will not constantly get context.
Here's a vim cscope tutorial and a blog post about Ruby / Vim / cscope and another blog post , both of which include additional tips on navigating Ruby / Rails in Vim.
Using grep or ack from Vim with fastfix integration is another great way to find characters. They have no concept of scope / context, but often a simple search is enough. Using only the built-in command :grep , you can do:
:grep some_method app/controllers :cwindow
And get the search results in the quickfix window, which allows you to quickly jump to matching files and line numbers.
A much better option is the ack.vim plugin, which integrates ack with Vim and uses quickfix windows.
If you are not already using the CTAGS navigation plugin, I recommend Tagbar .
source share