On 2009-08-12, Philip Rhoades wrote:
> Gary,
>
>
> On 2009-08-12 03:27, Gary Johnson wrote:
> > On 2009-08-11, Philip Rhoades wrote:
> >
> >> 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
> >
> >> 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" . .
> >
> > It works fine for me. I copied your example code into a file named
> > foo.rb and opened it. Typing % caused the cursor to jump from "if"
> > to "else" to "end" and back to "if".
> >
> > For that test I was using vim 7.2.148 on Cygwin with matchit.vim
> > version 1.13.1 (one version older than the latest) and
> > ftplugin/ruby.vim version 1.40 2008/06/29 04:18:43.
>
>
> Very odd - I thought from what had been written that on Linux everything
> needed was installed with vim so I just put these lines in my .vimrc file:
>
> filetype plugin on
> runtime plugin/matchit.vim
The matchit.vim script is installed with vim, but it's in the macros
directory, not in the plugin directory. I wrote
runtime macros/matchit.vim
If matchit.vim was in the plugin directory, the runtime command
would not be needed--matchit.vim would be loaded automatically. I
don't know why it's in the macros directory instead of in the plugin
directory.
> But when I checked, the matchit plugin was not there so I downloaded and
> installed it but still no improvement so I read the doc (!) and changed
> the last line in .vimrc to:
>
> :source ~phil/.vim/plugin/matchit.vim
>
> but still no joy. What is really odd is that "g%" ie the reverse
> movement works fine!
>
> I have:
>
> vim v7.2.148-1
> matchit.vim v1.13.2, for Vim 6.3+
I suppose the problem could be some other plugin interfering with
these. To make sure it wasn't working for me because of some
peculiarity of my setup, I started vim like this:
vim -N -u NONE
Then within vim, executed these:
:runtime macros/matchit.vim
:filetype detection on
:e foo.rb
where foo.rb contains your example code. The % worked fine. Try
that and see if it works any better for you. That's pretty much
what you already tried with your simple .vimrc except that your
experiment also loaded all your plugins as well, whereas starting
vim with -u NONE also inhibits the loading of plugins.
Alternatively, you could repeat your experiment but start vim as
vim --noplugin
Regards,
Gary
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---