我想用VScode的键绑定制作切换键。 alt + 1到5切换浏览器和搜索,scm,调试扩展
我可以找到“ explorerViewletVisible”或“ searchViewletVisible” 但是我找不到scm(源代码控制)和调试扩展的可视性。 我为这些键使用“ sideBarVisible”,但这不是一个完美的解决方案。 有没有人知道这些情况的“何时表达”?
{
"key": "alt+1",
"command": "workbench.view.explorer",
},
{
"key": "alt+1",
"command": "workbench.action.toggleSidebarVisibility",
"when": "explorerViewletVisible"
},
{
"key": "alt+2",
"command": "workbench.view.search",
},
{
"key": "alt+2",
"command": "workbench.action.toggleSidebarVisibility",
"when": "searchViewletVisible"
},
{
"key": "alt+3",
"command": "workbench.view.scm",
},
{
"key": "alt+3",
"command": "workbench.action.toggleSidebarVisibility",
"when": "sideBarVisible"
},
答案 0 :(得分:1)
我找到了自己的方式。 采用 “ when”:“ sideBarFocus && activeViewlet =='workbench.view.explorer'”
答案 1 :(得分:0)
但是我找不到scm(源代码控制)和调试的可见性, 扩展程序。
如果您想要求sideBar集中焦点并打开这些视图,则
"when": "sideBarFocus && activeViewlet == 'workbench.view.scm'"
"when": "sideBarFocus && activeViewlet == 'workbench.view.debug'"
"when": "sideBarFocus && activeViewlet == 'workbench.view.extensions'"
如果您只想确保打开这些视图(并且允许其他一些焦点,例如编辑器),则只需删除sideBarFocus
部分:
"when": "activeViewlet == 'workbench.view.scm'"
"when": "activeViewlet == 'workbench.view.debug'"
"when": "activeViewlet == 'workbench.view.extensions'"