Visual studio code VSCode具有键绑定的多个/多个任务

Visual studio code VSCode具有键绑定的多个/多个任务,visual-studio-code,Visual Studio Code,我想为2个以上的任务添加2个以上的键绑定。大约5-10分钟 现在我有这个: // Place your key bindings in this file to overwrite the defaults [ { "key": "ctrl+alt+s", "command": "workbench.action.tasks.test" }, { "key": "ctrl+alt+d", "command": "workbench.action.tasks.build" } ]

我想为2个以上的任务添加2个以上的键绑定。大约5-10分钟

现在我有这个:

// Place your key bindings in this file to overwrite the defaults
[
    { "key": "ctrl+alt+s", "command": "workbench.action.tasks.test" },
    { "key": "ctrl+alt+d", "command": "workbench.action.tasks.build" }
]


{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "command": "npm",
    "isShellCommand": true,
    "showOutput": "always",
    "suppressTaskName": true,
    "tasks": [
        {
            "taskName": "npm start",
            "isTestCommand": true,
            "args": ["start"]
        },
        {
            "taskName": "npm dist",
            "isBuildCommand": true,
            "args": ["run", "dist"]
        }
    ]
}

如何添加更多内容?

使用vscode 1.10的更新版本,您现在可以将密钥绑定到任何任务。发布文档描述了这一点。 根据链接中的示例,您可以执行以下操作:

{
    "key": "ctrl+h",
    "command": "workbench.action.tasks.runTask",
    "args": "tsc"
}
它将ctrl+h绑定到名为tsc的任务