How to navigate to a closing bracket with ReSharper?
Asked Answered
B

4

13

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?

Biophysics answered 16/12, 2011 at 21:3 Comment(3)
See https://mcmap.net/q/64201/-go-to-matching-brace-in-visual-studio/171703Whack
akiller - please entered this as an answer. while you are not the first one telling me about Ctrl + ], you are the first one telling me it is already part of VS and not ReSharper.Biophysics
That's the problem with using a tool like re#... sometimes you don't know where the line is (I, too, didn't realize it was a Studio shortcut).Jedidiah
W
6

See Go to Matching Brace in Visual Studio? (now as an answer as requested!)

Whack answered 16/12, 2011 at 21:21 Comment(0)
K
21

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.

Knur answered 16/12, 2011 at 21:33 Comment(0)
W
6

See Go to Matching Brace in Visual Studio? (now as an answer as requested!)

Whack answered 16/12, 2011 at 21:21 Comment(0)
I
3

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.

Isotropic answered 30/11, 2015 at 9:22 Comment(1)
The normal procedure worked well for me. No need to remove the shortcut on the other command first. VS 2019, v.16.11.9.Waterloo
J
1

Visual Studio's shortcut is (under the IntelliJ shortcut set): Control + ] when your cursor is on the opening brace goes to the ending brace. The inverse is also true.

Jedidiah answered 16/12, 2011 at 21:8 Comment(1)
Resharper has no such shortcut, that's Visual Studio. Resharper does have Ctrl+[ in the IDEA and VS schemes though--which is actually /go to containing declaration/ and doesn't have anything to do with bracketsMaladjustment

© 2022 - 2024 — McMap. All rights reserved.