23

In Notepad++ for example when your cursor is next to a brace it will highlight the corresponding opening or closing brace on screen.

Check out the link below for a example as to what I mean. http://www.atmel.com/webdoc/visualassist/visualassist._match.html

How can Visual Studio do this?

Walt Ritscher
  • 6,977
  • 1
  • 28
  • 35
Pie
  • 856
  • 4
  • 12
  • 33

1 Answers1

39

The Visual Studio 2013 C# editor has brace highlighting. Place the cursor on the outside of the brace, (not the inside) to see the highlight.

Default Brace color

The default color is very subtle, use the Tools\Options\Fonts And Colors setting to apply a different highlight color.

Fonts and Colors setting

New Brace Color

Walt Ritscher
  • 6,977
  • 1
  • 28
  • 35
  • 1
    Is there a way to have this work on xml files and other files? Not just C# ones? – Pie Jul 20 '15 at 02:50
  • What to you want to match in the XML file? The elements? – Walt Ritscher Jul 20 '15 at 07:21
  • 6
    In Visual Studio 2015, I had to change the `Brace Matching` display item rather than `Brace Matching (Rectangle)`, to notice the color. – Ehtesh Choudhury Feb 09 '17 at 21:46
  • @EhteshChoudhury, yes, In VS 2015, there is an additional entry Brace Matching, which is the correct setting to change the values. I think it has to do with this bug. http://stackoverflow.com/questions/27756510/how-to-set-the-color-of-matching-braces-in-vs-2015 – Walt Ritscher Feb 09 '17 at 22:39
  • 4
    In Visual Studio 2017, have to change the `Brace Matching` instead of the `Brace Matching (Rectangle)`. Thanks to Walt, that is very helpful especially I change the background to grey. So if the background for brace matching is also grey, the brace could not stand out. – Just a HK developer Jun 23 '17 at 01:55
  • Is there a way to see the matching brace if it is not currently on the screen? – Zack Nov 30 '17 at 00:32
  • 3
    @Zack You can move to the other brace with Ctrl+] – Walt Ritscher Dec 01 '17 at 07:27
  • I realise this is an old question but I can't see any reason why this answer hasn't been accepted. – Citrus May 31 '19 at 01:44
  • Is there a way to find the matching brace if I am inside the brace? – Yash Tamakuwala Sep 19 '21 at 10:43