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

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


文章目录


前言

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


一、终端自定义快捷键

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

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 面板变小

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

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

相关推荐
拾贰_C8 小时前
【VSCode | python | anaconda | cmd | PowerShell】在没有进入conda环境时使用conda命令默认安装位置
vscode·python·conda
阿华田5129 小时前
如何基于Jupyter内核自研NoteBook
ide·python·jupyter·自研notebook
Huanzhi_Lin11 小时前
常用IDE快捷键备忘
ide·快捷键
lingzhilab12 小时前
零知IDE——基于零知ESP32S3部署AI 小智,轻量化智能交互终端
ide·人工智能
lpfasd12312 小时前
一次 IDE Agent 死循环问题的架构复盘
ide·架构
@小博的博客12 小时前
Linux的工具第一篇:vim编辑器的使用详解
linux·编辑器·vim
magic_kid_201013 小时前
IDEA 复制到 Windows 远程桌面失败的原因与解决方案
java·ide·intellij-idea
贺今宵13 小时前
使用idea启动一个springboot项目
java·ide·intellij-idea
Alsn8613 小时前
27.IDEA 专业版创建与打包 Java 命令行程序
java·ide·intellij-idea
RwwH14 小时前
PyCharm虚拟环境创建
ide·python·pycharm