#StackBounty: #regular-expression #search #highlight Highlighting a search capture group

Bounty: 50

By :set hl, the search result of a / expression is highlighted, for example:

Vim search highlight in action

And if one wants to replace one substring distinguished by its surrounding, one can do so elegantly using regex capture groups:

replace not with and

However, the search highlight does not reflect this capture group. Sometimes, it would be very helpful if it did, so you can feel more confident about your attempted regex. Does Vim have such a feature?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.