Navigating around in the VS.NET IDE
Last week, Bill Wagner and I were providing some C# training for one of our clients. Bill showed the class how to use F12 to jump to the definition of a method. One of the students asked how to go back to your previous position and Bill didn't know the key binding off hand.
As someone who comes from a VB6 background, I've maintained my VB6 keyboard mappings since I moved to C# in 2003. Navigating around inside the VS.NET IDE has been a no-brainer for me since all of the keystrokes I used for the 7 or 8 years of VB development are the same in VS.NET -- assuming you use the VB6 keyboard layout.
I decided to see if C# has a default key binding to jump back to your previous positions after jumping to a method definition using F12. First off, I wanted to see what IDE command is mapped to my "go back" function. I pulled up the VS.NET IDE keyboard options, clicked on the "Press shortcut keys" texbox and hit the keyboard keystroke I use for jumping back to my previous position (Ctrl+Shift+F2):
Looking in the "Shortcut currently used by" field, I see "View.NavigateBackward" is the command used in the IDE to navigate back to your previous position. Now I changed my keyboard mapping scheme to C# and entered "View.NavigateBackward" into the "Show commands containing" field:
So I see control and "-" (minus) is the keystroke to jump back in C#. I changed my IDE settings to use C# and tested this out. Sure enough, I can use F12 to jump to a method definition and then ctrl+- to return to my previous position -- sort of like having my own little callstack within the IDE. :)
And now I've changed my settings back to VB6 mapping scheme since I'm a creature of habit!