How do I go to Matching Braces in Visual Studio 2019?

bhs67

Well-known member
Joined
Oct 11, 2021
Messages
52
Programming Experience
10+
In the past, ctrl+] would jump to the matching brace of '{' => '}'. Creating a shortcut --- Tools => Options => Environment => Keyboard =>Edit.GoToBrace => Use new shortcut in: Global => Ctrl+] => Assign --- does not work.

In the past, selecting a '{' would highlight the matching brace '}' with a different color (such as a yellow background). I don't recall how to do that.
 
Moving to VS forum instead of general C# discussion...
 
I have VS 2019 v16.11.5. Ctrl+] still works for me as in it jumps to the matching brace. I didn't have to do any specific keyboard assignments. Maybe it's because I'm old school and still use the VS2005 key assignments. I don't know what you kids are using nowadays.

Screenshot_1.png


With the Light color theme, I can see that the background of the matching brace is changed to a light gray when I press the key combination. I can't tell as much with the Dark theme, but looks to be some kind of shade of dark blue.

Perhaps when you are creating your shortcut, you should choose "Text Editor" instead of "Global" for "Use new shortcut in:"?
 
Works for me too, same VS version, default keyboard mapping.

Brace highlight setting is here (automatic delimiter highlighting)
It works when placing caret before opening or after closing brace.
 
I changed the mapping scheme to "Visual C# 2005" ... it works now.

For matching brace background color ... Tools => Options => Environment => Fonts and Colors => Brace Matching => Item Background

BTW I started writing code in 1968. :)
 
Last edited:
Keep on coding!

With your experience level, you don't even need these fancy IDEs. You could get by with a single line editor if you needed to. :) It is sometimes nice to have the convenience of the new features, though. Just like as much fun it is to drive a stick shift, it is no fun in rush hour stop and go traffic.
 
Back
Top Bottom