[英]How to create a custom command linked to a shortcut in VSCode
I am looking on how to create a custom command linked to a shortcut in VSCode.我正在研究如何创建链接到 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'"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.