views:

45

answers:

3

In working with code in VisualStudio 08 Pro i frequently find myself facing a closing brace (}) wondering exactly where the thing opened. If it's only one screen's worth I can seen the shaded character right away but usually have to scrollup and look close.

Is there a keyboard shortcut that jumps to the beginning of the matching brace?

thx

Ok...Cntl + ] works in pure c# code ... how about in an MVC aspx page?

And again with an edit to show better context:

...<%
else if (row.RegistrationType == RegistrationType.Live)
{ 
%>
<a id="Add" onclick="AddStuff();" >Imagine lots and lots of text here that obscures the above brace from it's match below.</a>
<%
}//cursor here hightlights the brace following the else
//but cntl+] only jumps up one line.
%>

+1  A: 

With the cursor on the closing brace:

Control + ]

Jay Riggs
+1  A: 

I think Control-] is the one you're looking for.

Tim Sylvester
A: 

In my version of VS2008 Ctrl + ^ allows you to jump between opening and clsing braces.

Don't know if the shortcut depends on the settings that were chosen when starting VS for the first time or on the keyboard layout.

M4N