[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    RE: regex repetition quantifier * in vim
From:       Bowie Bailey <Bowie_Bailey () BUC ! com>
Date:       2004-03-30 17:18:34
Message-ID: 4766EEE585A6D311ADF500E018C154E30173DA4A () bnifex ! cis ! buc ! com
[Download RAW message or body]

From: qlerner@netvision.net.il [mailto:qlerner@netvision.net.il]
> Bowie Bailey wrote:
> > From: qlerner@netvision.net.il [mailto:qlerner@netvision.net.il]
> > >You can refer specifically to the match at which
> > >cursor is positioned. The command is:
> > >                   v//e
> >
> > This sounds interesting, but it doesn't seem to work for me.
> > .... What it seems to do for me is highlight everything from
> > where the cursor currently is to one character from the end of the
> > match.
> 
> That's right; v//e assumes that cursor is on the 1st character
> of the match.
> 
> Here is the mapping that selects whole current match no matter 
> where the cursor is inside the match:
> 
>     map <F9> l??b<CR>v//e<CR>

This still doesn't get it all.  It misses the last character of the
match.

Using the same example:

     the match
     ^^^^^^^^

In order to get it to work properly, I needed this map:

     map <F9> l??b<CR>v//e<CR>l


Ahh...after poking around a bit, I found the problem:

     set selection=exclusive

Your map only works properly if selection is set to "inclusive" (which
is the default).

Thanks for the tip.  I didn't know you could extend a visual block by
searching this way.  With Vim, there's always something new.

Bowie
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic