我曾尝试了以下keybindings.json的ctrl+enter“command”设置,以启用.py[thon]脚本编辑器扩展程序时执行两个命令。单个命令可以工作,但是尝试将多个命令或包含多个命令的宏引用关联起来的尝试都无法正常工作。后者会生成“未找到命令'macros.<macro defined in settings.json>'”的错误信息。
请问如何将多个命令附加到单个键盘快捷方式定义中,特别是我配置宏的方法有什么问题?
请问如何将多个命令附加到单个键盘快捷方式定义中,特别是我配置宏的方法有什么问题?
// %appdata%\Code\User\keybindings.json
[
{
"key": "ctrl+enter",
//"command": "python.execSelectionInTerminal",
//"command": "cursorDown",
//"command": [ "python.execSelectionInTerminal", "cursorDown" ],
//"command": "python.execSelectionInTerminal, cursorDown",
//"command": "python.execSelectionInTerminal && cursorDown",
"command": "macros.pythonExecuteLineAndMoveToNextOne",
"when": "editorTextFocus && editorLangId == 'python'"
}
]
// %appdata%\Code\User\settings.json
{
"macros": {
"pythonExecuteLineAndMoveToNextOne": [
"python.execSelectionInTerminal",
"cursorDown"
]
},
.
. .
. . .
}