Visual Studio 2013: Matching Braces

This next feature only applies to C++ and C# just so you know. There are four things I want to talk about: highlighting, moving, selecting, and defining matching braces.



If you have any code with matching braces:

5-17-2012 11-58-44 AM


You can put your cursor to the left of any brace and it will highlight the matching one:

5-17-2012 11-27-24 AM





If you want to move the cursor from one brace to another simply press CTRL+] (close bracket) to jump, forward or backward, between them:

5-17-2012 11-29-09 AM





If you press CTRL+SHIFT+] (close bracket) then it will not only jump to the matching brace but will highlight everything between the braces as well:

5-17-2012 11-30-50 AM





Lastly, the definition of “brace” is very loose and applies to square brackets, curly braces, and parentheses:

5-17-2012 11-32-40 AM


So feel free to use this feature set with just about any type of brace.

Comments (1)

  1. Mac says:

    Seems to be a bug with the highlighting code. I found it extremely confusing that the dark blue highlight color is so similar to the selected-text color, so I changed it to a dark red — but for some reason in CSS files it still uses dark blue.