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)

相关推荐
淘矿人12 小时前
[特殊字符] 别再手动写提示词了!Claude Skills 10分钟入门,效率暴涨200%,Token狂省78%
人工智能·vscode·python·pycharm·github·文心一言·ai编程
纯.Pure_Jin(g)17 小时前
寒假Python班作业(三)
开发语言·vscode·python
pyniu18 小时前
芋道系统生成代码步骤
ide
速易达网络19 小时前
速易达画图工具:轻量全能,让创意跃然“屏”上
编辑器
山峰哥19 小时前
SQL优化实战:从索引策略到查询性能提升的深度解析
开发语言·数据库·sql·性能优化·编辑器
嵌入小生0071 天前
进程的基本概念\相关命令\创建\调度\状态及相关函数接口---软件编程---嵌入式(Linux)
linux·vscode·vim·嵌入式·进程·fork·软件编程
程序员ken1 天前
献给自己的一款个人管理的桌面软件(二)
python·c#·编辑器
番茄去哪了1 天前
苍穹外卖day03-----菜品管理
java·开发语言·数据库·ide·git·学习·maven
jaysee-sjc2 天前
【练习十一】Java实现电影信息管理系统:电影上架、下架、查询、修改、封杀
java·开发语言·ide·算法·intellij-idea
托洛夫斯基扎沙耶2 天前
Unity可视化工具链基础
unity·编辑器·游戏引擎