2017-03-04 21 views
0

我想添加更多的2個keybinds到更多的2個任務。像大約5-10。使用keybind VSCode multiple/many tasks

現在我有這樣的:

// 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"] 
     } 
    ] 
} 

你怎麼能添加更多?

回答

1

使用vscode 1.10的更新版本,您現在可以將密鑰綁定到任何任務。 Here是描述這個的發佈文檔。 按照鏈接中的例子,你可以這樣做:

{ 
    "key": "ctrl+h", 
    "command": "workbench.action.tasks.runTask", 
    "args": "tsc" 
} 

結合Ctrl + H鍵名爲TSC

任務