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)

相关推荐
笑望灬星辰5 小时前
VS Code 编辑器 Git 工具 - 分支操作【保姆级教程】
git·vscode·编辑器
Java小白中的菜鸟6 小时前
创建自己的obsidian模版
ide
山峰哥8 小时前
SQL性能提升20倍的秘密:这些优化技巧让DBA都惊叹
开发语言·数据库·sql·编辑器·深度优先·宽度优先
Peter·Pan爱编程9 小时前
第六篇:VS Code + Continue 插件:开源爱好者的低成本高自由度方案
ide·开源·ai编程
Karle_10 小时前
为AI编辑器准备c++编译环境,onnxruntime、cmake、cl,网上坑太多备份记录后续方便使用。
开发语言·c++·编辑器
la_vie_est_belle11 小时前
Pygame Studio——用Python自制的一款可视化游戏编辑器
python·游戏·编辑器·游戏引擎·pygame·pyside6·pygame-ce
Thanks_ks11 小时前
【第 002 讲】Python 标准开发环境搭建:运行环境 | 环境变量 | IDE 部署 | 配置优化
ide·python·pycharm·开发工具·环境配置·环境变量·编程基础
shughui11 小时前
2026年最新版Python安装和PyCharm安装教程(图文详细 附安装包)
开发语言·windows·python·pycharm·编辑器
白云LDC20 小时前
Android Studio新建Vecter asset一直显示Loading icons(转圈圈)的解决办法
android·ide·android studio
An_s21 小时前
编辑器AI工具(vscode+claude)
ide·vscode·编辑器