Is there a way to go 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 one command, is that possible?
I've read this documentation, but it doesn't seem to work on .rb files, I've read in some places that it only works on C (haven't tried though).
Thanks in advance.
Looks like there is an official package at rubyforge that has some support for this:
The Ruby ftplugin now includes Ruby specific implementations for the [[, ]], [], ][, [m, ]m, [M, and ]M normal mode commands. These allow you to move to move quickly between module, class and method declarations.
Edit: The README says that these files are included in the default VIM distro but they don't work for me in GVIM on Windows, '{' and '}' seem to work on vim under Linux
%
It works with most languages where it's clear that your cursor is on or near a block marker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With