有人知道在Visual Studio Code中切换编辑器和集成终端的快捷键(Mac和Linux)吗?
当前回答
对于版本:1.26.1 (linux),默认情况下没有设置快捷方式。 设置快捷方式
打开键盘快捷键面板[ctrl + k, ctrl + s] 搜索焦点终端
设置快捷方式
编辑器的焦点已默认设置。
其他回答
Ctrl + J作品;但也显示/隐藏控制台。
cmd+J表示mac
通常,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"
}
]
根据键盘布局的不同(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"
}
我的1.56 VS Code的工作原理是:
Ctrl + ~ to focus on terminal window from editor
Ctrl + 9 to focus back on editor from terminal
推荐文章
- 打开同一目录两次
- 如何从终端/命令行调用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单引号到双引号自动替换