RE: regex repetition quantifier * in vim
- From: qlerner@... [mailto:qlerner@...]
> Bowie Bailey wrote:This still doesn't get it all. It misses the last character of the
> > From: qlerner@... [mailto:qlerner@...]
> > >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>
Using the same example:
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:
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.