How to run a custom task (other than validation or assembly) from keychord in VSCode?

I know that I can assign keychord to two standard tasks: buildand testin VSCode. I need to do the same with a custom task. How can i do this?

+4
source share
3 answers

Use with . runTaskargs

{
    "key": "shift+cmd+t",
    "command": "workbench.action.tasks.runTask",
    "args": "The name of your task"
}
+2
source

You cannot currently. Here is the github problem with function request. It seems that he continues to fall into the "next" release.

+1
source

, . , ...

AutoHotKey:

Run a fixed command line using the keyboard shortcut:

^!1::Run mytask.exe myfile.txt

The above command launches the command line mytask.exe myfile.txtwhen you press Ctrl+ Alt+ 1.

If you want to limit the scope of the label from global only to VSCode, add # IfWinActive before this line.

Of course, you can also expand the macro to define the file dynamically (or from user input), but I wanted to show you a minimal example, which is a transition method.

+1
source

Source: https://habr.com/ru/post/1666023/


All Articles