Reputation: 2911
I can jump to code if I click in a method name and hit F12. But, is there a keyboard short cut to jump back to the previous code editor location?
Upvotes: 150
Views: 78445
Reputation: 1738
On the top menu bar, right click and it'll give you an option -> 'command center'. See the arrow after you select it.
Upvotes: 1
Reputation: 4149
On Windows:
Alt + ←
... navigate back
Alt + →
... navigate forward
On Mac:
Ctrl + -
... navigate back
Ctrl + Shift + -
... navigate forward
On Ubuntu Linux:
Ctrl + Alt + -
... navigate back
Ctrl + Shift + -
... navigate forward
Upvotes: 2
Reputation: 585
In Visual Studio Code, you can also use Alt + Left-Arrow to return to your original location in the source code after navigating with F12.
Upvotes: 4
Reputation: 502
While Ctrl- and CtrlShift- are indeed the shortcuts to navigate to the previous/next cursor position, in this particular case (i.e., going back after F12 or similar) this shortcut might be more useful:
CtrlShift8 (=View.PopBrowseContext
)
It will jump back to the place where you pressed F12, ignoring any cursor locations after you pressed F12.
(NOTE: currently using VS 2013, and hoping this shortcut entry also exists in VS 2010...)
Upvotes: 16
Reputation: 1970
@Oded is correct, but wait, there's more!
Upvotes: 25