Visual Studio Code. How can I add several command

2019-09-13 05:22发布

问题:

I want to execute 2 commands on 1 hotkey "F4"

  1. workbench.action.toggleSidebarVisibility
  2. workbench.action.toggleActivityBarVisibility

I am trying to use this code, but it doesn't work.

{
  "key": "F4",                
  "command": "workbench.action.toggleSidebarVisibility && workbench.action.toggleActivityBarVisibility" 
}

回答1:

Not possible, at least not as of today with a vanilla installation.

But you can try this extension here, it creates macros from multiple commands, which can then be bound to a shortcut: https://marketplace.visualstudio.com/items?itemName=geddski.macros