Andy Wokula wrote

> Am 07.10.2019 um 13:51 schrieb Dominique Pell??:
> > Hi
> >
> > Vim now highlights matching text when
> > typing an Ex command like :%s/foobar/
> > I like it. But I wish that it would use
> > a different color for the regex captured group(s).
> >
> > For example, if I do   :%s/foo\(bar\)/
> > I would like "bar" (the captured group) to
> > be highlighted with a different color than foo
> > in matching text, so it's easier to visually see
> > that my regexp matches and what \1 is
> > when I do  :%s/foo\(bar\)/\1/.  In this example
> > the regexp and captured group are obvious
> > of course, so a different color may not seem
> > useful. But it becomes more useful when the
> > the regex is more complex.
> >
> > There are 10 possibly regexp groups.  Having 10
> > different colors might be overkill (not sure).
> > The same color for any group may good enough,
> > or perhaps alternative colors for \1 \2 \3...?
> >
> > I wonder whether other vim users would also
> > find it useful.
> >
> > Regards
> > Dominique
>
> What about nesting / overlapping group matches (?):
>      /foo\(ba\(baz\)r\)
>
> can be several levels deep.

The outer group in your example is \1 and the
inner group is \(baz\) is \1.  Highlighting of inner group
should shadow highlighting of outer groups I would
say in the common portion of the matched text.

So matching text when searching for /foo\(ba\(baz\)r\)
could look like this for example if:
* Search group is yellow
* \1 is light brown
* \2 is darker brown
  xxfoobabazrxx
But multiple colors for \1, \2 (etc) is maybe overkill.
Personally I'd be happy enough with a single color for all
captured groups, i.e.:
  xxfoobabazrxx
Regards
Dominique

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAON-T_gqt%3DEtZODO0izhM6P%2B9W5KC5uEDOaTGER605SNt_VUeA%40mail.gmail.com.

Raspunde prin e-mail lui