Navigate Back & Forth in VS Code

Published 23 Feb 2020 · 1 min read
How to Navigate Back and Forth in VS Code

If you come from a traditional programming background such as Java or C++, you're probably used to fully featured IDE's such as IntelliJ or Eclipse. Since developers spend a lot more time reading and navigating other people's code than writing it, you'll often find yourself having started in one class/method, which invokes some other method, jump to definition, which invokes another and so-on. Pretty soon you find yourself 10 levels deep in the call hierarchy, then want to navigate back to where you started.

Turns out there is a keyboard shortcut for this navigation in VS Code but I always forget it. Documenting it here in the hope that writing it down will burn it in my brain, and help out anyone else that's looking for it. For some reason, I find these unintuitive, if going back uses -, would expect going forward to use +.

The shortcuts for Mac are:

Ctrl + - to navigate back

Ctrl + Shift + - to navigate forward