People,
On 2009-08-11 15:37, Gary Johnson wrote:
> On 2009-08-10, drostin77 wrote:
>> I am coding more and more ruby, and I am missing the ability to hit % and
>> have vim take me to the start/end of the block I am on.
>>
>> I.e.
>>
>> if vimCanDoThis
>> happy = true
>> else
>> happy = false
>> end
>>
>>
>> If I am on "end" and hit %, it would be really neat if vim took me to the
>> "if." At the least when it is a do/end this seems manageable, i.e.:
>>
>> (1..5).each do |i|
>> puts "its been " + i.to_s + " iterations. Can vim do this yet?"
>> end
>>
>> I realize ends can map to various things, whereas in most (for fear of
>> saying all) languages a { always matches a }. But is this possible / is
>> there a plugin to do this?
>
> The ruby.vim filetype plugin together with the matchit.vim script
> should do this. Both come with vim.
>
> If you don't already have filetype detection enabled, put this in
> your _vimrc or ~/.vimrc:
>
> filetype plugin on
>
> There are a number of ways to load the matchit.vim script. The most
> straightforward is probably to put this in your _vimrc or ~/.vimrc:
>
> runtime macros/matchit.vim
When I do this and the cursor is on the "if":
- the first "%" puts the cursor on the "else"
- the second "%" puts the cursor on the "end"
- the third "%" puts the cursor back on the "else"
ie there does not seem to be an option to get back to the "if" from the
"end" . .
Regards,
Phil.
--
Philip Rhoades
GPO Box 3411
Sydney NSW 2001
Australia
E-mail: [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---