VS Code 从搜索所有侧边栏返回到最后一个光标位置

发布于 2025-01-13 10:55:43 字数 239 浏览 2 评论 0原文

在 VS code 中,当光标当前位于打开的文档上时,通常可以使用 alt+left 返回到上一个光标位置。但是,如果您按 ctrl+shift+f(在全部中查找),光标将跳转到在所有搜索侧栏中查找,并且要返回到文档中的最后一个位置,您必须使用光标(crtl+left不会工作)。

有没有办法从 VS Code 中的搜索结果侧栏移回到文档中的最后一个位置? (例如,在 Jetbrains 产品中,esc 就可以解决问题,因为搜索结果实际上是模态的)

in VS code you can normally use alt+left to go back to the last cursor position when your cursor is currently on an opened document. however, if you will press ctrl+shift+f (find in all) the cursor will jump to the find in all search side-bar, and to return to the last position in the document you have to use your cursor (crtl+left won't work).

is there a way to move back from the search results side-bar to the last position in the document in VS code? (in Jetbrains products, for example, esc will do the trick because the search results are actually in a modal)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妥活 2025-01-20 10:55:43

命令 workbench.action.focusActiveEditorGroup 将执行您想要的操作。因此,您可以设置这样的键绑定(在 keybindings.json 中):

{
  "key": "alt+left",
  "command": "workbench.action.focusActiveEditorGroup",
  "when": "searchViewletFocus"        // probably not necessary, but safer
}

请参阅 自定义键绑定以了解如何访问 keybindings.json 文件。

The command workbench.action.focusActiveEditorGroup will do what you want. So you could set up a keybinding like this (in keybindings.json):

{
  "key": "alt+left",
  "command": "workbench.action.focusActiveEditorGroup",
  "when": "searchViewletFocus"        // probably not necessary, but safer
}

See customizing keybindings to learn how to access the keybindings.json file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文