我认为没有任何内置方法可以做到这一点。您可以很容易地使用宏来完成它。使用像multi-command这样的宏扩展将其放入您的设置中:
"multiCommand.commands": [
{
"command": "multiCommand.NextEditorOtherGroup",
"sequence": [
"workbench.action.focusNextGroup",
"workbench.action.nextEditorInGroup",
"workbench.action.focusNextGroup"
// "workbench.action.focusPreviousGroup" if you more than two editor groups for example
]
},
{
"command": "multiCommand.PreviousEditorOtherGroup",
"sequence": [
"workbench.action.focusNextGroup",
"workbench.action.previousEditorInGroup",
"workbench.action.focusNextGroup"
]
}
]
宏只关注另一个编辑器组(它假设你只有两个,如果你有更多宏可以修改以关注right/last/most recently used
编辑器组。在关注另一个编辑器组之后,它移动到另一个编辑器中的下一个/上一个编辑器组,然后将焦点返回到另一个组(因为您只有两个编辑器组focusNextGroup
在这里工作得很好,如果您有更多并且想要返回到以前集中的组使用workbench.action.focusPreviousGroup
)。
然后是您想用来触发这些宏的任何键绑定(在 keybindings.json 中):
{
"key": "alt+q", // trigger the macro with any keybinding you wish
"command": "extension.multiCommand.execute",
"args": { "command": "multiCommand.NextEditorOtherGroup" },
"when": "editorTextFocus"
},
{
"key": "shift+alt+q", // any keybinding
"command": "extension.multiCommand.execute",
"args": { "command": "multiCommand.PreviousEditorOtherGroup" },
"when": "editorTextFocus"
},