Is there a way to highlight brackets when the cursor is anywhere within the enclosing brackets? Default settings highlight it only when I place the cursor near the brackets.
To specify the color to highlight matching delimiters, go to Visual Studio options (Tools | Options), open the Environment | Fonts and Colors page, and select the desired colors for the ReSharper Brace Outline and/or ReSharper Matched Brace items.
There are multiple right answers for achieveing what was required. Here are my two cents anyway. The operation to quickly jump to the opening or the closing bracket has to be instant. The Ctrl + Shift + \ is pretty verbose if you ask me.
Yes, there is now a way by default, in VSCode 1.40 (October 2019):
Improvements to bracket matching
Previously, VS Code would only highlight matching brackets when the cursor was next to a bracket character.
Now VS Code will always highlight enclosing brackets if they exist.
We have also adjusted our
Go to Bracket
andSelect to Bracket
actions to use enclosing brackets.
It is improved and supported natively with VSCode 1.60 (Aug. 2021):
Bracket pair colorization can be enabled by setting
"editor.bracketPairColorization.enabled": true
.
All colors are themeable and up to six colors can be configured.
VS Code only supports bracket matching when the cursor is near the opening or closing bracket. Maybe an extension would help highlight the enclosing brackets wherever you are in the code but I haven't been able to find one.
If you just want to quickly find matching brackets, braces, parens, etc. you could try Bracket Pair Colorizer or Rainbow Brackets.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With