Is there any command to go to the end (or beginning) of a Ruby block using vim

Is there a way to put the end of a Ruby block using vim? for example

module SomeModule # <Supposing that the cursor is HERE> def some_method end end 

I want to go from where the cursor is to the end of the block with a single command?

I read this documentation , but it doesn't seem to work on .rb files, I read in some places that it only works in C (I haven't tried it yet).

Thanks in advance.

+6
ruby vim
source share
3 answers

There seems to be an official rubyforge package that has some support for this:

Ruby ftplugin now includes specific Ruby implementations for [[,]], [],] [, [m,] m, [M, and] M normal mode commands. They allow you to quickly navigate between declarations of the module, class, and method.

Change README says these files are included in the VIM distribution by default, but they don’t work for me in GVIM on Windows, '{' and '}' seem to work on vim under Linux

+3
source share
 % 

It works with most languages, where it clearly indicates that your cursor is on or near the block marker.

+3
source share

Try this: http://www.vim.org/scripts/script.php?script_id=303 (Disclaimer: Unverified)

-one
source share

All Articles