A couple of ideas:
Firstly, make a mapping to use the C function searching keys in ~/.vim/after/ftplugin/ruby.vim
:
:nmap [[ ?def <CR>
:nmap ]] /def <CR>
Then you can use [[
and ]]
to go forward and back a function, just like in C/Perl/Java code etc.
Another way that might help:
In .vimrc
, add the line:
:let ruby_fold = 1
Then use zj
, zk
, z[
and z]
to navigate by folds. You could also install this plugin so that you can easily delete folds using daz
.
For finding specific functions (rather than just navigating around them) you'll want to use ctags (as mentioned by chillitom). The taglist plugin makes it much easier to navigate to a specific function, but (as chillitom said) Ctrl-] and Ctrl-T are useful for following keywords under the cursor.
For more information, see:
:help [[
:help ft-ruby-syntax
:help z[
:help after-directory