Reputation: 656
More specifiaclly I need VSCode to "run python file in terminal" on Ctrl+R if .py file is opened, or perform a build task otherwise. There is a "when" field in keyboard shortcuts menu but I can't figure out how to set it properly for my case.
Upvotes: 0
Views: 77
Reputation: 28783
You can specify the languageId in the keybindings.json
file when
clause.
"when": "editorLangId == 'python'"
and in the GUI use editorLangId == 'python'
Upvotes: 2