[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

vim and '%': no brackets, how to navigate instead?

Markus Fischer

5/21/2009 9:29:00 AM

Hi,

coming from languages which extensively use brackets I'm very accustomed
in using % to jump between start/end. How this is getting a bit tricky,
if not to say "no possible" because of the lack of all the brackets
(which I find refreshing, btw).

But I guess it's not that easy, % would need to be able to jump between
"class" and "end", "if" and "end", "while" and "end", etc.

Is there an easy way to change this behavior or is there some kind of
ready-made plugin available? I'm runnig gvim on win32 and although it
has ruby support (compiled it; syntax files) it doesn't seem to support
this.

thanks,
- Markus
2 Answers

Jeff Schwab

5/21/2009 1:50:00 PM

0

Markus Fischer wrote:
> Hi,
>
> coming from languages which extensively use brackets I'm very accustomed
> in using % to jump between start/end. How this is getting a bit tricky,
> if not to say "no possible" because of the lack of all the brackets
> (which I find refreshing, btw).
>
> But I guess it's not that easy, % would need to be able to jump between
> "class" and "end", "if" and "end", "while" and "end", etc.
>
> Is there an easy way to change this behavior or is there some kind of
> ready-made plugin available?

Yes:
http://vim-ruby.ruby...

I also highly recommend:
http://www.vim.org/scripts/script.php?scri...
http://www.vim.org/scripts/script.php?sc...

Markus Fischer

5/21/2009 4:36:00 PM

0

Hi,

Jeff Schwab wrote:
> Markus Fischer wrote:
>> Is there an easy way to change this behavior or is there some kind of
>> ready-made plugin available?
>
> Yes:
> http://vim-ruby.ruby...

thanks, it works now. However, it was my own stupidity actually. I found
that page already and I was reading about matchit but somehow wasn't
able to put the puzzle together.

For the record: gvim on Windows comes with everything already, it just
that the matchit plugin resides in the macro/ dir of vim and to use it,
it has to be in the plugin/ directory.

cheers,
- Markus