在Visual Studio Code中导航回光标最后位置的快捷键是什么?
当前回答
macOS:
⌘+ U:撤销上次游标操作
您也可以尝试按Ctrl + -。
顺便说一下,所有的快捷键都在macOS的键盘快捷键中。这真的很有用!
其他回答
键盘快捷命令为“前进”和“返回”。
在Windows上:
Alt +←...navigate回来
Alt +…向前导航
在Mac:
Ctrl + -…返回
Ctrl + Shift + -…向前导航
在Ubuntu Linux下:
按下ctrl+alt+…navigate to back
Ctrl + Shift + -…向前导航
我使用的是Mac OS X,所以我不能回答Windows用户的问题:
我添加了一个自定义keymap条目,并将其设置为Ctrl +←+ Ctrl +→,而最初的默认值是Ctrl + -和Ctrl + Shift+ -(在我的德语键盘上翻译为Ctrl +ß和Ctrl + Shift+ß)。
你可以简单地在用户键映射设置中修改它:
{ "key": "ctrl+left", "command": "workbench.action.navigateBack" },
{ "key": "ctrl+right", "command": "workbench.action.navigateForward" }
对于接受的答案,我实际上想知道:)Alt +←/ Alt +→为我跳跃文字(这是所有编辑器的一种标准)。他们真的为Windows版本做了这样的映射吗?
使用 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 1.43 (Q1 2020)中,那些Alt+←/ Alt+→或Ctrl+- / Ctrl+Shift+-也将…保存的选择。
参见第89699期:
Benjamin Pasero (bpasero) adds:
向后/向前移动可以还原选择。 请注意,为了获得历史条目,位置之间至少需要10行才能将该条目视为新条目。
推荐文章
- 打开同一目录两次
- 如何从终端/命令行调用VS代码编辑器
- 如何在Visual Studio代码中重置设置?
- 如何将制表符转换为空格,反之亦然,在现有的文件
- 错误:'types'只能在.ts文件中使用- Visual Studio Code使用@ts-check
- Visual Studio Code: .git文件夹/文件隐藏
- 使iTerm以与其他操作系统相同的方式翻译“元键”
- Visual Studio Code:如何调试Python脚本的参数
- 如何在Visual Studio代码中触发参数提示?
- 在VS Code中禁用“Comments are not allowed In JSON”错误
- 使用正则表达式搜索和替换Visual Studio代码
- 如何缩进/格式选择的代码在Visual Studio代码?
- 是否有一种方法可以在Visual Studio中删除一行而不剪切它?
- 如何在Eclipse中只使用键盘去一个错误?
- 你常用的Xcode快捷键有哪些?