Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to back navigate Ctrl+click files in VSCode?

I Ctrl + click through various function definitions, in Go. Sometimes I drill too deep. I want to move up the stack of visited files. How do I do this in VS Code?

like image 591
Virmundi Avatar asked Oct 03 '18 13:10

Virmundi


2 Answers

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.

like image 84
Alex Myers Avatar answered Sep 20 '22 03:09

Alex Myers


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

File -> Preferences -> Keyboard Shortcuts.

or just press CTRLK + CTRL 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.

enter image description here

like image 21
nPcomp Avatar answered Sep 18 '22 03:09

nPcomp