How to navigate back to the last cursor position in Visual Studio Code?

前端 未结 10 2018
梦如初夏
梦如初夏 2020-11-30 15:50

What is the keyboard shortcut navigate back to the last cursor position in Visual Studio Code?

相关标签:
10条回答
  • 2020-11-30 16:28

    You can go to File -> Preferences -> Keyboard Shortcut. Once you are there, you can search for navigate. Then, you will see all shortcuts set for your VS Code environment related to navigation. In my case, it was only Alt + - to get my cursor back.

    0 讨论(0)
  • 2020-11-30 16:30

    As an alternative to the keyboard shortcuts, here's an extension named "Back and Forward buttons" that adds the forward and back buttons to the status bar:

    https://marketplace.visualstudio.com/items?itemName=grimmer.vscode-back-forward-button

    0 讨论(0)
  • 2020-11-30 16:36

    Alt+ /

    You can find here all shortcuts

    https://code.visualstudio.com/docs/customization/keybindings

    0 讨论(0)
  • 2020-11-30 16:37

    This will be different for each OS, based on the information at https://code.visualstudio.com/docs/customization/keybindings

    Go Back: workbench.action.navigateBack Go Forward: workbench.action.navigateForward

    Linux Go Back: Ctrl+Alt+-
    Go Forward: Ctrl+Shift+-

    OSX ⌃- / ⌃⇧-

    Windows Alt+ /

    0 讨论(0)
  • 2020-11-30 16:38

    The Keyboard Shortcut Commands are Go Forward and Go Back.


    On Windows:

    Alt+ .. navigate back

    Alt+ .. navigate forward

    On Mac:

    Ctrl+- .. navigate back

    Ctrl+Shift+- .. navigate forward

    On Ubuntu Linux:

    Ctrl+Alt+- .. navigate back

    Ctrl+Shift+- .. navigate forward

    0 讨论(0)
  • 2020-11-30 16:40

    The answer for your question:

    1. Mac:
      (Alt+) For backward and (Alt+) For forward navigation
    2. Windows:
      (Ctrl+-) For backward and (Ctrl+Shift+-) For forward navigation
    3. Linux:
      (Ctrl+Alt+-) For backward and (Ctrl+Shift+-) For forward navigation


    You can find out the current key-bindings following this link

    You can even edit the key-binding as per your preference.

    0 讨论(0)
提交回复
热议问题