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)

相关推荐
mrsyf1 天前
VSCode中Copilot的询问、编辑、代理有啥区别?
ide·vscode·copilot
你很易烊千玺1 天前
处理wangEditor编辑器缩进问题
编辑器
晨尘光1 天前
【pycharm 创建一个线程,在线程函数中增加的日志打印,日志打印了,但是打断点进不去】
ide·python·pycharm
正经教主1 天前
【App开发】Mumu模拟器安装使用与Android Studio连接指南
android·ide·android studio
lxmyzzs1 天前
vscode-ssh无法进入docker问题解决
vscode·docker·ssh
Candice_jy1 天前
vscode运行ipynb文件:使用docker中的虚拟环境
服务器·ide·vscode·python·docker·容器·编辑器
不染尘.1 天前
2025_11_5_刷题
开发语言·c++·vscode·算法·贪心算法·动态规划
-大头.1 天前
Node.js 环境变量配置全攻略
node.js·编辑器·vim
拿破轮1 天前
不小心在idea中点了add 到版本控制 怎么样恢复?
java·ide·intellij-idea