微軟的vscode,作為時下最流行的幾款編輯器之一。剛出來的時候我就開始體驗了。其實這幾年用過挺多的編輯器,影響比較深的就只有前端利器webstorm還有小清新atom,至于為什么轉(zhuǎn)投到vscode就仁者見仁智者見智了,就不多說了。
這里主要介紹下我自己的關(guān)于vscode自帶的終端的快捷鍵設(shè)置,默認的終端切換實在是太麻煩啦··
-
可以通過cmd+shift+p,搜索keyboard看下快捷鍵設(shè)置
-
在設(shè)置里點擊keybindings.json打開配置json
-
在打開的配置文件中里搜索terminal。可以看到關(guān)于終端切換的沒有匹配的快捷鍵,放在這里也是要讓我們自己擴展的意思。
最后在keybinding.json中把下面的代碼復制過去覆蓋默認值,當然,綁定的快捷鍵你們可以根據(jù)自己習慣調(diào)整。
// 將鍵綁定放入此文件中以覆蓋默認值
[
{
"key": "ctrl+tab",
"command": "workbench.action.terminal.focusNext", // 切換到下一個終端
"when": "terminalFocus"
},
{
"key": "ctrl+w",
"command": "workbench.action.terminal.kill", // 關(guān)閉當前終端
"when": "terminalFocus"
},
{
"key": "ctrl+t",
"command": "workbench.action.terminal.new", // 打開新的終端
"when": "terminalFocus"
},
{
"key": "ctrl+1",
"command": "workbench.action.terminal.focusAtIndex1", // 打開終端1
"when": "terminalFocus"
},
{
"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"
}
]