I am attempting to learn C#, and found the standard Ctrl+Alt+N
does not work, and the tutorials online regarding building C# projects all seem to only mention using the command line with dotnet run
. I have no problem with the command line, but it would greatly help my workflow if I didn't have to switch to mouse or trackpad to click the terminal and then back again.
From the VS Code extensions Marketplace download and install the "terminal-command-keys" (by Pete Kinnecom) extension.
Open "keybindings.json" file (View > Command Palette > search for: " >preferences:Open Keyboard Shortcuts (JSON)"
In "keybindings.json" file put the following code inside the brackets "[]" :
{
"key": "cmd+3",
"command":"terminalCommandKeys.run",
"args":{
"cmd": "dotnet run"
}
}
Save your "keybindings.json" file. (I have assigned "cmd + 3" key combination to "dotnet run" command. Use your own favorite key combination!
Notes:
Source: Medium: Francis Mendez
Not sure about VSCode, but in normal VS build is Shift+Ctrl+B
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With