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)

相关推荐
田野与天1 小时前
jupyter 文件浏览器,加强版,超好用,免费exe
ide·python·jupyter
张小凡vip3 小时前
pycharm已有python3.7,如何新增Run Configurations中的Python interpreter为python 3.9
ide·python·pycharm
小白鼠零号3 小时前
记录 | Pycharm中如何调用Anaconda的虚拟环境
ide·python·pycharm
打工人你好7 小时前
Visual Studio Code 在.S汇编文件中添加调试断点及功能简介
汇编·ide·vscode
叶羽西7 小时前
Windows VsCode Terminal窗口使用Linux命令
ide·vscode·编辑器
夜月yeyue7 小时前
VScode+OpenOCD+HTOS栈回溯在国产mcu芯片上完全调试
c语言·ide·vscode·单片机·嵌入式硬件·编辑器
James. 常德 student11 小时前
Markdown 编辑器的使用
编辑器
weixin_7488770011 小时前
【Node.js中的错误处理:策略与最佳实践】
node.js·编辑器·vim
YiSLWLL12 小时前
Tauri 2.3.1+Leptos 0.7.8开发桌面应用--Sqlite数据库的写入、展示和选择删除
数据库·vscode·rust·sqlite·sqlx
软件开发-NETKF888813 小时前
idea报错java: 非法字符: ‘\ufeff‘解决方案
java·ide·intellij-idea