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


当前回答

适用于任何键盘布局的简单WINDOWS解决方案(可能适用于其他操作系统,但未经测试)

我使用芬兰键盘,所以上面没有一个工作,但这应该适用于所有的键盘。

终端焦点:将鼠标悬停在集成终端的终端文本上。聚焦终端的快捷方式将会弹出-例如,我说CTRL+ö。 编辑器焦点:如上所述,使用CTRL+1。

其他回答

我的1.56 VS Code的工作原理是:

Ctrl + ~     to focus on terminal window from editor
Ctrl + 9     to focus back on editor from terminal

我把我的配置如下,因为我发现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。

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

根据键盘布局的不同(QWERTY/QWERTZ/AZERTA等)

要找到你的快捷键,按Ctrl+Shift+P,然后转到首选项:键盘快捷键。

从那里搜索视图:切换终端

我的解决方案:

只有一把钥匙 如果还没有终端:打开一个终端并聚焦在它上面 如果焦点在终端上:隐藏面板并切换回编辑器 如果焦点在编辑器上并且有一个终端:取消终端窗格并聚焦在它上

  {
    "key": "ctrl+shift+alt+cmd+t",
    "command": "workbench.action.terminal.new",
    "when": "!terminalIsOpen"
  },
  {
    "key": "ctrl+shift+alt+cmd+t",
    "command": "terminal.focus",
    "when": "terminalIsOpen && !terminalFocus"
  },
  {
    "key": "ctrl+shift+alt+cmd+t",
    "command": "workbench.action.closePanel",
    "when": "terminalIsOpen && terminalFocus"
  }