views:

101

answers:

2

Say that I'm writing a test and my caret is here (indicated by "|"):

[ExpectedException(typeof(InvalidOperationException|))]

In Visual Studio 2010, I'd like to press some shortcut that would take me to the next line so that I could start typing "public void Etc()".

Right now, I need to press

Right arrow
Right arrow
Right arrow
Enter

Edit: It can be

End
Enter

But that wouldn't work well if the next statement was on the same line. I'm still looking for a generic command to jump to next statement (or maybe language token should I say).

Is there a VS2010 / ReSharper shortcut to aid this?

A: 

"End" key on your keyboard then "Return" for a newline?

ChrisBD
I didn't pick the best example, you're right in this specific case but I've amended the question to more clearly state what shortcut I'm after.
Borek
+1  A: 

In VS2k8 it is Edit.LineOpenBelow = Ctrl+Shift+Enter? Don't know if the same is in VS2k10.

bretik
Not exactly 'Jump to next statement' but will work fine in 90% cases which I find good enough. Accepting as answer, thanks.
Borek
Hmm it doesn't work in VS2010 if the ExpectedException from the sample is the last thing in the class. Maybe a VS bug?
Borek
Maybe... Doesn't work in 2k8 either. When I try to hold ctrl+shift+enter, I see bunch of ")" appending at the end of line and disappearing immediately, but the caret stays where it was.
bretik
I created a simple macro for "End+Enter" and mapped it to Ctrl+Shift+Enter. Does most of what I need.
Borek