有人知道在Visual Studio Code中,Mac和Linux系统下在编辑器和集成终端之间切换焦点的键盘快捷键吗?
有人知道在Visual Studio Code中,Mac和Linux系统下在编辑器和集成终端之间切换焦点的键盘快捷键吗?
keybindings.json
中,但我建议您通过按键绑定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"
},
我的解决方案:
{
"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"
}
我是通过进入设置>键盘快捷方式,然后在给出搜索栏的部分中输入“聚焦终端”并选择选项来完成此操作的。它会要求您输入要为此操作设置的组合键。进行操作。至于编辑器焦点,请在搜索栏中输入“编辑器焦点”并输入您想要的键。如果您优秀地添加了一个键,可以按照上面的评论所述进入编辑jason删除它。
按下 control + '~' 可以在两者之间切换。'`' 按键位于 Tab 键上方。 这个快捷键只在 Mac 上有效。
ctrl
+ -
也可以,它的意思是返回上一个光标位置
ctrl
+ ' ` ' 也能在Windows上完美运行! - Ehtesham ZCTRL
+```的问题在于即使已经存在一个终端,它也会创建一个新的终端。 - Guss