How to back navigate Ctrl+click files in VSCode?

You can use workbench.action.navigateBack and workbench.action.navigateForward to quickly move back and forth between recent cursor positions.

  • The default keybinding for workbench.action.navigateBack is Alt+LeftArrow
  • The default keybinding for workbench.action.navigateForward is Alt+RightArrow

If your mouse has buttons on the side, you can use them in place of the above keybindings.


To assign your custom key combinations, just like the @Virmundi mentioned, click on the

File -> Preferences -> Keyboard Shortcuts.

or just press CTRL + K + S

Type workbench.action.navigateBack double click on the found line and assign your shortcut key combination for moving backward.

Similarly, type workbench.action.navigateForward and assign your key for moving forward.