VS Code:如何配置 Go to File 命令以自动选择上一个文件(如 Sublime) [英] VS Code: How to configure Go to File command to auto-select the previous file (like Sublime)

查看:52
本文介绍了VS Code:如何配置 Go to File 命令以自动选择上一个文件(如 Sublime)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在 Sublime 中触发 Go to File 命令,不要输入任何内容,然后按回车键它会自动选择以前查看过的文件:

If I trigger the Go to File command in Sublime, don't type anything, and hit enter it auto-selects the previously viewed file:

在 VS Code 中,Go to File 命令会自动选择当前文件,这意味着我必须输入文件名或点击向下箭头.

In VS Code, the Go to File command auto-selects the current file, which means I have to type the file name or hit the down arrows.

如果触发转到文件命令,我需要更改什么设置才能自动选择以前查看的文件?

What setting do I need to change so that the previously viewed file is auto selected if I trigger the Go to File command?

推荐答案

没有这样的设置,但是看到同样的问题:https://github.com/Microsoft/vscode/issues/26977(使用 Ctrl-P 时默认选择上一个文件).解决方案是将其添加到您的 keybindings.json:

There is no such setting, but see the same issue: https://github.com/Microsoft/vscode/issues/26977 (Select previous file by default when using Ctrl-P). The solution is to add this to your keybindings.json:

{
  "key": "ctrl+p",  // or cmd
  "command": "workbench.action.quickOpenPreviousEditor"
}

现在 Ctrl+P 将打开文件快速打开面板,并选择上一个文件.

Now Ctrl+P will open the file quickopen panel with the previous file selected.

如果您更喜欢转到文件..."键绑定 Ctrl+E 那么您应该在上面的新键绑定中使用它而不是 Ctrl+P.

If you prefer the "Go to File..." keybinding Ctrl+E then you should use that in the above new keybinding instead of Ctrl+P.

这篇关于VS Code:如何配置 Go to File 命令以自动选择上一个文件(如 Sublime)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆