有人知道在Visual Studio Code中切换编辑器和集成终端的快捷键(Mac和Linux)吗?


当前回答

Control + '~'将用于在两者之间切换。' "就在标签按钮的上方。 这个快捷方式只能在mac中使用。

其他回答

100%工作设置…

[
    { "key": "alt+right", "command": "workbench.action.terminal.focus"},
    { "key": "alt+left", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"}   
]

从编辑器切换到 终端。workbench.action.focusActiveEditorGroup:切换 从终端到编辑器。

另一种选择是使用F6和shift+F6。

F6点击“聚焦下一部分”,将焦点从编辑器移动到下面的面板(终端、输出、调试控制台等)。

shift+F6点击“聚焦前一部分”,将焦点从终端面板移回编辑器。

与ctrl + '相比,this的优势在于:

它不隐藏终端/面板(如果这是你喜欢的。如果您喜欢隐藏/取消隐藏终端,那么只需使用ctrl + ')。 这将适用于任何面板(终端,输出,调试控制台等)。

我通过设置>键盘快捷键来做到这一点,然后在它给出一个搜索栏类型的焦点终端的部分中选择该选项。它将要求输入您想要为此操作设置的组合。这样做。至于编辑器焦点,在搜索栏中输入“编辑器焦点”,并输入您想要的键。如果你出色地添加了一个键。可以通过编辑上面评论中提到的Jason来删除它

下面是我的方法,它提供了在活动终端之间导航的一致方式,以及在终端和编辑器窗格之间跳转而无需关闭终端视图。您可以尝试将此添加到您的键绑定。我建议你使用键盘绑定UI (Mac上的cmd+K cmd+S),这样你就可以检查/管理冲突等。

这样,我可以使用ctrl+x <箭头方向>导航到任何可见的编辑器或终端。一旦光标在终端部分,您可以使用ctrl+x ctrl+up或ctrl+x ctrl+down在活动终端中循环。

cmd-J仍然用于隐藏/显示终端窗格。

    {
        "key": "ctrl+x right",
        "command": "workbench.action.terminal.focusNextPane",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+x left",
        "command": "workbench.action.terminal.focusPreviousPane",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+x ctrl+down",
        "command": "workbench.action.terminal.focusNext",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+x ctrl+up",
        "command": "workbench.action.terminal.focusPrevious",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+x up",
        "command": "workbench.action.navigateUp"
    },
    {
        "key": "ctrl+x down",
        "command": "workbench.action.navigateDown"
    },
    {
        "key": "ctrl+x left",
        "command": "workbench.action.navigateLeft",
        "when": "!terminalFocus"
    },
    {
        "key": "ctrl+x right",
        "command": "workbench.action.navigateRight",
        "when": "!terminalFocus"
    },

我把我的配置如下,因为我发现ctrl+ '有点难按。

{
  "key": "ctrl+k",
  "command": "workbench.action.focusActiveEditorGroup",
  "when": "terminalFocus"
},
{
  "key": "ctrl+j",
  "command": "workbench.action.terminal.focus",
  "when": "!terminalFocus"
}

我还配置了以下内容,以便在编辑器组之间移动。

{
  "key": "ctrl+h",
  "command": "workbench.action.focusPreviousGroup",
  "when": "!terminalFocus"
},
{
  "key": "ctrl+l",
  "command": "workbench.action.focusNextGroup",
  "when": "!terminalFocus"
}

顺便说一下,我在Mac上从系统首选项=>键盘=>修改器键配置了Caps Lock。