在Visual Studio Code中导航回光标最后位置的快捷键是什么?
当前回答
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
其他回答
macOS:
⌘+ U:撤销上次游标操作
您也可以尝试按Ctrl + -。
顺便说一下,所有的快捷键都在macOS的键盘快捷键中。这真的很有用!
作为键盘快捷键的替代,有一个名为“后退和前进按钮”的扩展,它将前进和后退按钮添加到状态栏。
为了回答你的问题,为了:
窗口使用Alt+←向后导航,Alt+→向前导航。 macOS使用Ctrl+-向后导航,Ctrl+Shift+-向前导航。 Linux使用Ctrl+Alt+-进行后退导航,Ctrl+Shift+-进行前进导航。
您可以在“键盘快捷键编辑器”中找到当前的键绑定。
您甚至可以根据自己的喜好编辑键绑定。
最后编辑位置v.最后导航位置
转到最后编辑位置:
Ctrl + k Ctrl + q
sudormfbin的评论中提到了这一点,但没有作为答案。这是我99%的时间想做的事情,当我想“我现在在哪里?”这是最简单、最快捷的方式回到你的上一个位置,而不需要你的手指离开键盘使用方向键,也不需要安装扩展等。
导航最近的光标位置:
ALT+ ←背面
ALT +→前进
大多数其他发布的解决方案都提到了这一点——在“导航位置”之间移动,即在编辑器选项卡之间或在编辑器内部导航(例如,你将光标移动到一行上,然后单击上面20个空格的行)。
对于在编辑器选项卡之间导航,而不是上面的,你可以按Ctrl+Tab,因为它会按照最近的顺序对所有选项卡进行排序,这样你就可以选择去其他选项卡,或者只是释放并回到最后使用的选项卡。手指也不用离开键盘。
键盘快捷命令为“前进”和“返回”。
在Windows上:
Alt +←...navigate回来
Alt +…向前导航
在Mac:
Ctrl + -…返回
Ctrl + Shift + -…向前导航
在Ubuntu Linux下:
按下ctrl+alt+…navigate to back
Ctrl + Shift + -…向前导航
推荐文章
- 如何在Visual Studio代码中触发参数提示?
- 在VS Code中禁用“Comments are not allowed In JSON”错误
- 使用正则表达式搜索和替换Visual Studio代码
- 如何缩进/格式选择的代码在Visual Studio代码?
- 是否有一种方法可以在Visual Studio中删除一行而不剪切它?
- 如何在Eclipse中只使用键盘去一个错误?
- 你常用的Xcode快捷键有哪些?
- 如何禁用预览文件与点击在vs代码?
- Visual Studio代码更改文件资源管理器托盘的字体大小?
- 如何防止Visual Studio Code总是重新打开以前的文件或文件夹?
- VSCode单引号到双引号自动替换
- 如何删除Visual Studio代码中的重复行?
- 在Eclipse中更改字符串的大小写
- 如何设置每个文件类型的标签大小?
- 我如何添加环境变量启动。VSCode中的json