set showmatch highlights matching brackets. Is there a way to highlight all text between brackets? I have a black background. When I land on a bracket, I'd like to change the background of the in-between text to dark gray.

2 Answers 2


This approach isn't automatic, but v% should show you the text (and conveniently select it in visual mode for further processing).

Alternately, you could use an autocommand or mapping to create a textprop or similar to highlight the region of interest, and then use a timer to clear it (if desired). See :help searchpairpos() for a helpful function to get data about the region to highlight.


It does what it says to do: show (briefly) matching parens/brace/bracket/anglequote. What you're asking for (highlight all text within delimiter) is something very different... Maybe activate search highlight with se hls then issue a relevant search?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.