Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go to Matching Brace in Visual Studio?

Is there a way in Visual Studio 2008 to go from a closing brace to its opening brace? I've found a fair amount of stuff about highlighting the brace, but nothing about moving the cursor to it.

(VB.NET version of this Question: Keyboard shortcut for Jumping between "If/End If")

like image 354
thepocketwade Avatar asked Oct 01 '09 04:10

thepocketwade


People also ask

How do you match braces in Visual Studio?

I found this for you: Jump between braces in Visual Studio: Put your cursor before or after the brace (your choice) and then press CTRL + ] . It works with parentheses ( ), brackets [ ] and braces { }. From now on you don't need to play Where's Waldo? to find that brace.

How do I jump to a closing bracket in Visual Studio code?

Command "editor. action. jumpToBracket" jumps between opening and closing brackets.


2 Answers

I found this for you: Jump between braces in Visual Studio:

Put your cursor before or after the brace (your choice) and then press CTRL + ]. It works with parentheses ( ), brackets [ ] and braces { }. From now on you don’t need to play Where’s Waldo? to find that brace.

With the above shortcut, you can also hold SHIFT to select.

On MacOS, use CMD + SHIFT + \ .

like image 125
Tim Santeford Avatar answered Sep 22 '22 22:09

Tim Santeford


I use Visual Studio 2008, and you can customize what you want this shortcut to be.

Click menu Tools -> Options -> Environment -> Keyboard. Then look for Edit.GotoBrace.

This will tell you what key combination is currently assigned for this. I think you can change this if you want, but it's useful if the Ctrl + ] doesn't work.

like image 34
funkymushroom Avatar answered Sep 24 '22 22:09

funkymushroom