我正在尝试为 SublimeREPL 插件命令映射键盘快捷键。查看 SublimeREPL 看起来菜单项命令定义为:
Default.sublime-commands { "caption": "SublimeREPL: SBT for open folder", "command": "run_existing_window_command", "args": { "id": "repl_sbt", "file": "config/Scala/Main .sublime-menu" } }
或在
{"command": "repl_open",
"caption": "SBT for opened folder",
"id": "repl_sbt",
"mnemonic": "b",
"args": {
"type": "subprocess",
"encoding": "utf8",
"external_id": "scala",
"cmd": {"linux": ["sbt"],
"osx": ["sbt"],
"windows": ["sbt"]},
"soft_quit": "\nexit\n",
"cwd": "$folder",
"cmd_postfix": "\n",
"extend_env": {"osx": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
"linux": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
"windows": {"EMACS": "1"}},
"suppress_echo": false,
"syntax": "Packages/Scala/Scala.tmLanguage"
}
}
我尝试在我的 SublimeREPL.sublime-settings 中进行键绑定:
[{ "keys": ["super+shift+k"], "command": "run_existing_window_command", "args":
{
"id": "repl_sbt",
"file": "config/Scala/Main.sublime-menu"
}
}]
但是当我尝试使用它时,Sublime 控制台只会说:
选择器没有命令:noop:
如果我将其映射到:
[{ "keys": ["super+shift+k"], "command": "repl_open",
"args": {
"type": "subprocess",
"encoding": "utf8",
"external_id": "scala",
"cmd": {"linux": ["sbt"],
"osx": ["sbt"],
"windows": ["sbt"]},
"soft_quit": "\nexit\n",
"cwd": "$folder",
"cmd_postfix": "\n",
"extend_env": {"osx": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
"linux": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
"windows": {"EMACS": "1"}},
"suppress_echo": false,
"syntax": "Packages/Scala/Scala.tmLanguage"
}
}]