当前位置:   article > 正文

vscode 系列文章目录 - 终端自定义快捷键配置

vscode 系列文章目录 - 终端自定义快捷键配置

vscode 系列文章目录 - 终端配置



前言

在 vscode 中时常需要在多个内嵌终端中进行操作,如 log面板, build面板,package面板和repo面板,其中涉及到自定义快捷键。比如切换终端、创建新终端、改变终端面板大小等操作。


一、终端自定义快捷键

快捷键 Ctrl + Shift + P 输入 Preferences: Open Keyboard shortcurs(JSON),输入:

	// 将键绑定放在此文件中以覆盖默认值auto[]
	// 终端快捷键控制
    { "key": "ctrl+1",  "command": "workbench.action.terminal.focusAtIndex1", "when": "terminalFocus" }, //  Ctrl + 1~9 用于切换终端
    { "key": "ctrl+2",  "command": "workbench.action.terminal.focusAtIndex2", "when": "terminalFocus" },
    { "key": "ctrl+3",  "command": "workbench.action.terminal.focusAtIndex3", "when": "terminalFocus" },
    { "key": "ctrl+4",  "command": "workbench.action.terminal.focusAtIndex4", "when": "terminalFocus" },
    { "key": "ctrl+5",  "command": "workbench.action.terminal.focusAtIndex5", "when": "terminalFocus" },
    { "key": "ctrl+6",  "command": "workbench.action.terminal.focusAtIndex6", "when": "terminalFocus" },
    { "key": "ctrl+7",  "command": "workbench.action.terminal.focusAtIndex7", "when": "terminalFocus" },
    { "key": "ctrl+8",  "command": "workbench.action.terminal.focusAtIndex8", "when": "terminalFocus" },
    { "key": "ctrl+9",  "command": "workbench.action.terminal.focusAtIndex9", "when": "terminalFocus" },
    { "key": "ctrl+t",  "command": "workbench.action.terminal.new" }, // Ctrl + t 用于创建新终端
    { "key": "alt+pageup", "command": "workbench.action.terminal.resizePaneUp", "when": "terminalFocus" }, // Alt + PageUp 面板变大
    { "key": "alt+pagedown", "command": "workbench.action.terminal.resizePaneDown", "when": "terminalFocus" } // Alt + PageDown 面板变小
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

之后在快捷键 Ctrl + ` 切换到终端界面后,可以使用以上快捷键进行操作。

其中,快捷键的 key 可参考 快捷键 Ctrl + Shift + P 输入 Preferences: Open Keyboard shortcurs(JSON)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/345834
推荐阅读
相关标签
  

闽ICP备14008679号