有人知道在Visual Studio Code中切换编辑器和集成终端的快捷键(Mac和Linux)吗?
当前回答
为了在ctrl+ '组合之间进行切换,我尝试了所有列出的答案,但运气不好。对于那些像我一样有类似问题的人,尝试以下键绑定中的快捷方式。在VSCode 1.59+上测试
[
{
"key": "ctrl+oem_8","command": "workbench.action.terminal.focus", "when": "!terminalFocus"
},
{
"key": "ctrl+oem_8","command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"
}
]
其他回答
有点晚了,但我在keybindings.json中配置了我的如下:
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
"when": "editorTextFocus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "alt+`",
"command": "workbench.action.terminal.toggleTerminal"
}
我想要单独的键来打开/关闭终端和在窗口之间来回切换焦点。
通常,VS Code使用ctrl+j打开终端,所以我创建了一个键绑定来切换与ctrl+k组合,如下在keybindings.json:
[
{
"key": "ctrl+k",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+k",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
}
]
这不是确切的问题,但我发现它非常有用和相关。
如果有人想从一个终端切换到另一个终端,也可以在Visual Studio的集成终端面板中打开,您可以搜索:
终端:关注下一个终端
或者添加以下快捷键,用键盘组合更快。
{
"key": "alt+cmd+right",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
},
{
"key": "alt+cmd+left",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus"
},
嘿,我的工作步骤是:
CTRL + shift+ p,寻找首选项:键盘快捷键
或者你可以使用CTRL k + CTRL s直接打开它
在搜索框中寻找终端:焦点终端,我为自己设置了alt + T alt + T,但你可以选择你想要的组合 在搜索框中搜索“视图:焦点活动编辑器组”,为自己设置alt + E alt + E,但同样你可以选择你想要的组合
就是这样,我希望这对你有所帮助
我把我的配置如下,因为我发现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。
推荐文章
- 如何设置每个文件类型的标签大小?
- 我如何添加环境变量启动。VSCode中的json
- 如何格式化Visual Studio Code项目中的所有文件?
- Pylint在Visual Studio代码中“未解决的导入”错误
- 如何在VS Code中默认打开文本换行
- 在Visual Studio代码中更改突出显示文本的颜色
- Visual studio代码-键盘快捷键-全部展开/折叠
- Visual Studio Code无法检测已安装的Git
- 禁用Visual Studio代码中的工具提示提示
- Visual Studio Code -将空格转换为制表符
- 在VSCode中的列自动硬换行
- Visual Studio Code:格式没有使用缩进设置
- 如何排除文件扩展名和语言从“格式保存”在VSCode?
- Visual Studio代码- URI的目标不存在" package:flutter/material.dart "
- VSCode——如何设置调试Python程序的工作目录