【问题标题】:VS Code: How to configure Go to File command to auto-select the previous file (like Sublime)VS Code:如何配置 Go to File 命令以自动选择上一个文件(如 Sublime)
【发布时间】:2019-12-03 21:03:14
【问题描述】:

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

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

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

【问题讨论】:

    标签: visual-studio-code sublimetext3 vscode-settings


    【解决方案1】:

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

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

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

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

    【讨论】:

    • 太棒了。谢谢@Mark
    猜你喜欢
    • 2018-07-11
    • 2021-12-01
    • 2020-04-10
    • 1970-01-01
    • 1970-01-01
    • 2011-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多