Reputation: 13
Please don't flag as duplicate without reading. Seriously not able to find this information anywhere.
I work on projects that make use of "Make". Right now I have to type every make command in the integrated terminal like "make all", "make clean" etc. I'd like to have some keyboard shortcuts that do the work, similar to how default build tasks have one.
I tried command runner extensions but they too have very vague info on how to make these custom commands. Been fiddling around with settings and keybindings json file for few days now. I'm not a web developer so don't know much about working with json files to begin with and configure stuff observing the default templates.
All I find is the default template of
{
key : " ",
command : " "
}
Tried fiddling with this on keybindings.json file but my command is not found.
Any help on this would be much appreciated.
Upvotes: 1
Views: 684
Reputation: 28803
With the command workbench.action.terminal.sendSequence
you can send text to the terminal
An example key binding
{
"key": "ctrl+f5", // or any other combo
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "make all\u000D" }
}
Be sure the terminal is at a directory where the command works, or add a cd
command in front, you can use variables (credit to Mark for the correction).
If you define multiple tasks to do the stuff you can execute the task with a keybinding
{
"key": "shift+f5", // or any other combo
"command": "workbench.action.tasks.runTask",
"args": "Name_of_task"
}
In the task you can use variables.
Upvotes: 2