I am looking on how to create a custom command linked to a shortcut in VSCode. Like so:
{
"key": "shift+enter",
"command": "-python.execSelectionInTerminal",
"when": "editorTextFocus && !findInputFocussed && !jupyter.ownsSelection && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python'"
},
{
"key": "shift+enter",
"command": "-workbench.action.terminal.findNext",
"when": "terminalFindFocused && terminalProcessSupported"
},
{
"key": "shift+enter",
"command": "-python.execSelectionInTerminal",
"when": "terminalFindFocused && terminalProcessSupported"
},
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "${fileDirname}"
}
]
}
keybindings.json
{
"key": "shift+enter",
"command": "workbench.action.tasks.runTask",
"args": "Python: Current File",
"when": "editorTextFocus && editorLangId=='python'"
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.