The internal name is "workbench.action.navigateBack" and "workbench.action.navigateForward", and I've assigned "control-up" and "control-down" to it (left and right would have been more logical, but somehow that didn't work).
This is incredibly powerful and I have the impression that not a lot of people know or use it, it's kind of tucked away and doesn't even have default key bindings.
Sorry, I mixed up the two. I found cursor undo/redo in the keybindings menu, and thought it was that. It is like a much more toned-down version of Navigation. It only changes your cursor position, and skips to the beginning of the file if the "history stack" is empty.
Navigation is so much better!, as it navigates between files, and works at all times, not just when an editor is focused.
My VS Code keybindings for Navigation:
workbench.action.navigateBack: Alt + LeftArrow (default)
workbench.action.navigateForward: Alt + RightArrow (default)
workbench.action.navigateToLastEditLocation: Alt + K (default was Ctrl + K, Ctrl + Q)
left and right would have been more logical, but somehow that didn't work
Ctrl + LeftArrow/RightArrow don't work because they are Windows keyboard controls (also in pretty much all OSes). They navigate to the left and right of words.
For example (| represents cursor):
"I am some tex|t." => LeftArrow => "I am some |text."
"I am| some text." => RightArrow => "I am some| text."
VS Code calls this "cursor undo/redo". I really need to use this more often 😄.
The default for undo is
Ctrl + U
. Redo has no binding by default.Not sure if that's what it's called, but I've (re)defined it like this, in keybindings.json:
The internal name is "workbench.action.navigateBack" and "workbench.action.navigateForward", and I've assigned "control-up" and "control-down" to it (left and right would have been more logical, but somehow that didn't work).
This is incredibly powerful and I have the impression that not a lot of people know or use it, it's kind of tucked away and doesn't even have default key bindings.
Sorry, I mixed up the two. I found cursor undo/redo in the keybindings menu, and thought it was that. It is like a much more toned-down version of Navigation. It only changes your cursor position, and skips to the beginning of the file if the "history stack" is empty.
Navigation is so much better!, as it navigates between files, and works at all times, not just when an editor is focused.
My VS Code keybindings for Navigation:
workbench.action.navigateBack
:Alt + LeftArrow
(default)workbench.action.navigateForward
:Alt + RightArrow
(default)workbench.action.navigateToLastEditLocation
:Alt + K
(default wasCtrl + K, Ctrl + Q
)Ah nice, I didn't know about the other one, but yeah "navigation" is indeed brilliant because it also navigates backwards/forwards across files ...
Ctrl + LeftArrow/RightArrow
don't work because they are Windows keyboard controls (also in pretty much all OSes). They navigate to the left and right of words.For example (
|
represents cursor):"I am some tex|t." => LeftArrow => "I am some |text."
"I am| some text." => RightArrow => "I am some| text."
Yeah that's why I chose different key combos for nav prev/next :)