我想做一個鍵系結:
- 當側邊欄可見時,底部面板不可見,按下隱藏側邊欄,再次按下顯示兩者。
- 當側邊欄不可見時,底部面板可見,按下隱藏底部面板,再次按下顯示兩者。
- 當側邊欄可見時,底部面板可見,按下以隱藏兩者,再次按下以顯示兩者。
- 當側邊欄不可見時,底部面板不可見,按顯示兩者,再次按隱藏兩者。
使用工具我知道命令
切換面板切換側欄可見性
如何在 Vscode 中做到這一點?

uj5u.com熱心網友回復:
這可以完成,但只能借助多命令等宏擴展或撰寫您自己的擴展。由于在某些情況下您需要一次運行 2 個命令 - 例如同時關閉或打開兩個視圖。
在您的keybindings.json:
{
"key": "alt 1", // whatever keybinding you like
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
"workbench.action.togglePanel",
"workbench.action.toggleSidebarVisibility",
]
},
"when": "panelVisible && sideBarVisible || !panelVisible && !sideBarVisible"
},
{
"key": "alt 1", // use same keybinding here
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
"workbench.action.togglePanel"
]
},
"when": "panelVisible && !sideBarVisible"
},
{
"key": "alt 1", // use same keybinding here
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
"workbench.action.toggleSidebarVisibility"
]
},
"when": "!panelVisible && sideBarVisible"
}
還有這些命令
workbench.action.closePanel
workbench.action.closeSidebar
但我不認為他們對你的情況有幫助。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/317403.html
標籤:视觉工作室代码 vscode 设置 vscode-扩展 vscode 调试器 vscode-任务
