In Visual Studio Code, is there a keyboard shortcut to navigate (move cursor) to the last edited position (like in all Jetbrains products with Ctrl
+Shift
+Backspace
)?
The CTRL
+-
shortcut moves to the last position (not the last edited position), which is less useful for me.
i am using with Visual Studio Code JetBrains IDE Keymap for Visual Studio Code:
Visual Studio Code Version 1.23.1 Commit d0182c3417d225529c6d5ad24b7572815d0de9ac Datum 2018-05-10T17:11:17.614Z Shell 1.7.12 Renderer 58.0.3029.110 Node 7.9.0 Architektur x64
Go to recent files: (Ctrl + T + R) [Ctrl + T to open search box, then type R] Go to last edit location: (Ctrl + Shift + Backspace) [different from navigate backward, which just goes to last cursor location -- this goes to last place where code was edited]
To launch the Define Keybinding widget, press Ctrl+K Ctrl+K. The widget listens for key presses and renders the serialized JSON representation in the text box and below it, the keys that VS Code has detected under your current keyboard layout.
Press Ctrl + Shift + L . This will select all words that match your current selection. It also adds a cursor to each text span matching your current selection. Simply start typing your replacement text and vscode will start replacing all instances of text matching your selection in-editor as you type.
Also see https://stackoverflow.com/a/71212026/836330 for new navigation commands in vscode v1.65. See that link for navigating to next/previous cursor locations (where the cursor was but maybe no actual edit there).
For last edited locations:
Go Forward in Edit Locations "workbench.action.navigateForwardInEditLocations" Go Back in Edit Locations "workbench.action.navigateBackInEditLocations" Go Previous in Edit Locations "workbench.action.navigatePreviousInEditLocations" Go to Last Edit Location // acts like a toggle between current and last edit location "workbench.action.navigateToLastEditLocation"
Associated context keys have been added to make assigning keybindings more powerful:
canNavigateBackInNavigationLocations
: Whether it is possible to go back in navigation locationscanNavigateForwardInNavigationLocations
: Whether it is possible to go forward in navigation locationscanNavigateToLastNavigationLocation
: Whether it is possible to go to the last navigation locationcanNavigateBackInEditLocations
: Whether it is possible to go back in edit locationscanNavigateForwardInEditLocations
: Whether it is possible to go forward in edit locationscanNavigateToLastEditLocation
: Whether it is possible to go to the last edit location
[EDIT]: v1.28.0 just added a command to go back to the last edited position, see release notes: navigate back to last edited position.
Navigate to last edit location
A new command Go to Last Edit Location (
workbench.action.navigateToLastEditLocation
) was added to quickly navigate to the last location in a file that was edited. The default keybinding is
Ctrl+K Cntrl+Q
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With