Reputation: 67
I'm currently using VSCode to edit latex documents. The setup I have is the latex document in one editor group to the left, and then the preview of the document (pdf) in another group to the right. Additionally, I keep some other files open in the right work group as well.
Is there a way to make a shortcut, which tabs through the files in right work group, while the focus remains on the left one?
Upvotes: 0
Views: 67
Reputation: 180875
I don't think there is any built-in way to do that. You can use a macro to do it though pretty easily. Using a macro extension like multi-command put this into your settings:
"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"
]
}
]
The macro just focuses the other editor group (it assumes you only have two, if you have more the macro could be modified to focus the right/last/most recently used
editor group as well. After focusing the other editor group it moves to the next/previous editor in that other group and then returns focus to the other group (since you only have two editor groups focusNextGroup
works perfectly fine here, if you had more and wanted to return to the previously focussed group use workbench.action.focusPreviousGroup
instead).
and then whatever keybindings you want to use to trigger those macros (in 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"
},
Upvotes: 1