2017-03-04 55 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

任务