Sublime REPL命令在Sublime Text 2中使用

我正在尝试为SublimeREPL插件命令映射键盘快捷键。 看着SublimeREPL,它看起来像一个菜单项命令被定义为:

Default.sublime-命令{ “字幕”: “SublimeREPL:SBT为打开的文件夹”, “命令”: “run_existing_window_command”, “ARGS”:{ “ID”: “repl_sbt”, “文件”:“配置/斯卡拉/主要.sublime-menu“}}

或in

Main.sublime菜单

               {"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": "nexitn",
                    "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设置中将键绑定为:

[{ "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": "nexitn",
                    "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"
                    }

}]

你的第一个键绑定是正确的,应该按预期工作。 位置在首选项 - >键绑定 - 用户文件。

[{ "keys": ["super+shift+k"], "command": "run_existing_window_command", "args":
        {
            "id": "repl_sbt",
            "file": "config/Scala/Main.sublime-menu"
        }
}]

根据你的描述,我怀疑其他一些命令是劫持超+ shift + k。

>>> sublime.log_commands(True)

会让你看到什么时候被调用。

链接地址: http://www.djcxy.com/p/90903.html

上一篇: key map sublimeREPL commands in Sublime Text 2

下一篇: Can Sublime Text jump inside <li>foo</li> with a shortcut?