有人知道在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"
}
推荐文章
- 打开同一目录两次
- 如何从终端/命令行调用VS代码编辑器
- 如何在Visual Studio代码中重置设置?
- 如何将制表符转换为空格,反之亦然,在现有的文件
- 错误:'types'只能在.ts文件中使用- Visual Studio Code使用@ts-check
- Visual Studio Code: .git文件夹/文件隐藏
- Visual Studio Code:如何调试Python脚本的参数
- 如何在Visual Studio代码中触发参数提示?
- 在VS Code中禁用“Comments are not allowed In JSON”错误
- 使用正则表达式搜索和替换Visual Studio代码
- 如何缩进/格式选择的代码在Visual Studio代码?
- 如何禁用预览文件与点击在vs代码?
- Visual Studio代码更改文件资源管理器托盘的字体大小?
- 如何防止Visual Studio Code总是重新打开以前的文件或文件夹?
- VSCode单引号到双引号自动替换