visual studio code keybindings - Running two or more commands with one shortcut

后端 未结 1 1108
离开以前
离开以前 2021-02-12 03:39

I have the following keybinding in VS code which toggles the position of the cursor between the active document and built-in terminal:

  // Toggle between termin         


        
1条回答
  •  深忆病人
    2021-02-12 04:42

    You would need a macro extension to run multiple commands from one keybinding.

    I now use multi-command and there are other macro extensions now.

    You can use this keybinding (in your keybindings.json) with the multi-command extension - no need for anything in settings.json:

    {
      "key": "oem_8",                            // or whatever keybinding you wish
      "command": "extension.multiCommand.execute",
      "args": {
        "sequence": [
          "workbench.action.files.save",
          "workbench.action.terminal.focus"
        ]
      },
      "when": "editorTextFocus"  // if you want this, you probably do
    }
    

    If you have more complicated macros you can still build them in your settings.json if you wish.

    0 讨论(0)
提交回复
热议问题