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
HTH,
Gary
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---