actboy168 / vscode-tasks

MIT License
37 stars 14 forks source link

How to assign a keyboard shortcut for a specific task #38

Closed kcvinker closed 1 year ago

kcvinker commented 1 year ago

Hi, thank you for this wonderful extension. How to assign a keyboard shortcut for a specific task ? I have 4 tasks which I created with this extension. But one among them is the most used. So I've decided to assign a shortcut key for that. Thanks in advance.

actboy168 commented 1 year ago

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

kcvinker commented 1 year ago

@actboy168 Thanks for the reply. But I want a little help with the command. "command": "workbench.action.tasks.runTask", What should I write here ? My task name is "Run Python Code"

actboy168 commented 1 year ago
{
  "key": "ctrl+h",
  "command": "workbench.action.tasks.runTask",
  "args": "Run Python Code"
}
kcvinker commented 1 year ago

Thanks a lot. Let me try this. :)