geddski / macros

macros support for VS Code
MIT License
166 stars 36 forks source link

execute external command #10

Open skest3qc opened 7 years ago

skest3qc commented 7 years ago

Hi, i would like to execute WinMerge with the path of the currently opened path, i do not know the command to execute external commands.

xoob commented 7 years ago

Try something like this:

// User Settings
{
  "macros": {
    "runBuild": [
      {"command": "workbench.action.tasks.runTask", "args": "build"}
    ]
  }
}

You'll also need to create a tasks.json:

// tasks.json
{
    "version": "0.1.0",
    "tasks": [
        {
            "taskName": "build",
            "command": "gulp",
            "args": ["build"],
            "isShellCommand": true
        }
    ]
}

See https://code.visualstudio.com/docs/editor/tasks#_binding-keyboard-shortcuts-to-tasks

YMMV, as bugs with runTask have been reported: https://github.com/Microsoft/vscode/issues/6550#issuecomment-296962459