Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to navigate to a closing bracket with ReSharper?

Say you have a large amount of C# code in an if statement. If you place your carat next to the opening bracket, is there a hotkey or something in ReSharper that will automatically take you to the closing bracket?

like image 962
Dan Appleyard Avatar asked Dec 16 '11 21:12

Dan Appleyard


People also ask

How do you enter the closed bracket code in Visual Studio?

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

Where is closing bracket 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 { }.


2 Answers

ReSharper assigns the shortcut (Control + ´ - I have german keyboard) to a different command. In order to restore it go to Tools - Options - Environment - Keyboard, search for Edit.GotoBrace and enter the desired shortcut key. See to what command it is currently assigned and then remove it for this command first by searching this command and clicking Remove. Then again search for Edit.GotoBrace and assign the shortcut.

Directly assigning without Removing it first didn´t work.

like image 110
huha Avatar answered Sep 30 '22 04:09

huha


VS offers this shortcut, regardless of whether you have R# installed.

Ctrl + ] will take you to the opening brace. Subsequent presses will jump between the RHS/LHS of the scope.

like image 37
Drew Noakes Avatar answered Sep 30 '22 04:09

Drew Noakes