在Visual Studio Code中导航回光标最后位置的快捷键是什么?


当前回答

为了回答你的问题,为了:

窗口使用Alt+←向后导航,Alt+→向前导航。 macOS使用Ctrl+-向后导航,Ctrl+Shift+-向前导航。 Linux使用Ctrl+Alt+-进行后退导航,Ctrl+Shift+-进行前进导航。

您可以在“键盘快捷键编辑器”中找到当前的键绑定。

您甚至可以根据自己的喜好编辑键绑定。

其他回答

键盘快捷命令为“前进”和“返回”。


在Windows上:

Alt +←...navigate回来

Alt +…向前导航

在Mac:

Ctrl + -…返回

Ctrl + Shift + -…向前导航

在Ubuntu Linux下:

按下ctrl+alt+…navigate to back

Ctrl + Shift + -…向前导航

使用 Alt + ← / →

您可以在Visual Studio代码的键绑定中找到所有快捷键。

Vscode v1.65添加了一些新命令,用于导航到最后/下一个编辑位置或最后/下一个光标位置。

编辑位置意味着有一个实际的编辑,而游标位置意味着您访问了那个位置,但不一定在那里进行了编辑。

默认情况下,编辑器导航位置将被添加 在编辑器之间导航,但在编辑器内部导航时也是如此(对于 例如,当切换笔记本单元格或更改文本中的选择时 编辑器)。如果你觉得太多的位置被记录,新的 添加了减少位置的命令: 导航位置(例如当使用“转到定义”时) 编辑位置(每当编辑器被更改时,例如在文本编辑器中输入时)

从https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_65.md

光标位置:

Go Forward in Navigation Locations
"workbench.action.navigateForwardInNavigationLocations"

Go Back in Navigation Locations
"workbench.action.navigateBackInNavigationLocations"

Go to Last Navigation Location
      // acts like a toggle between current and last cursor location
"workbench.action.navigateToLastNavigationLocation"

Go Previous in Navigation Locations
"workbench.action.navigatePreviousInNavigationLocations"

编辑地点:

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 locations canNavigateForwardInNavigationLocations: Whether it is possible to go forward in navigation locations canNavigateToLastNavigationLocation: Whether it is possible to go to the last navigation location canNavigateBackInEditLocations: Whether it is possible to go back in edit locations canNavigateForwardInEditLocations: Whether it is possible to go forward in edit locations canNavigateToLastEditLocation: Whether it is possible to go to the last edit location

作为键盘快捷键的替代,有一个名为“后退和前进按钮”的扩展,它将前进和后退按钮添加到状态栏。

根据Visual Studio Code的Key Bindings中的信息,这对于每个操作系统都是不同的。

工作台配置:

返回:workbench.action.navigateBack Go Forward: workbench.action.navigateForward

Linux:

返回:Ctrl+Alt+- 前进:Ctrl+Shift+-

Mac OS X:

返回:Ctrl + - 前进:Ctrl + Shift(⇧)+ -

窗口:

Go Back to: Alt +⬅️ Go Forward: Alt +➡️