1

I have a macro in vscode like so to switch to the previous buffer:

"macros": {
  "switchbuffer": [
    "workbench.action.showEditorsInActiveGroup",
    "selectNextSuggestion",
  ]
}

and when I invoke it, it opens the active editors in group but does not "go one down" in the list. How do I invoke an action similar to "downarrow" ?

maindoor
  • 67
  • 5

1 Answers1

2

Try this - it uses the correct command for the quickpick that is opened:

"macros": {
  "switchbuffer": [
     "workbench.action.showEditorsInActiveGroup",
     "workbench.action.quickOpenNavigateNextInEditorPicker"  // note this command
  ]
}

This automatically switches to the second entry in the editorsInActiveGroup quickpick. It works with the macro extension that I am using, multi command which I think is better at running the commands sequentially than the macros extension. If those commands don't work in maros, consider switching to multi command.

Or see How can I run multiple commands with a single VS Code keybinding without an extension? - you don't need a macro extension anymore to run multiple commands.

Mark
  • 143,421
  • 24
  • 428
  • 436