请参阅this SublimeREPL issue 以获取有关我如何让 Clojure REPL 工作的说明,至少在 XP 上(我还没有在 Win7 或 8 上尝试过)。基本上,我编辑了 Clojure 的菜单文件,并将命令从 lein repl 更改为 lein trampoline run -m clojure.main,出于某种原因,这成功了。我还将路径更改为$file,这样您就可以打开一个REPL,而您的project.clj 是Sublime 中的当前选项卡,并且REPL 应该继承项目的设置。
作为参考,完整的Packages/User/SublimeREPL/config/Clojure/Main.sublime-menu文件(Packages可通过Preferences -> Browse Packages...访问)如下:
[
{
"id": "tools",
"children":
[{
"caption": "SublimeREPL",
"mnemonic": "r",
"id": "SublimeREPL",
"children":
[
{"caption": "Clojure",
"id": "Clojure",
"children":[
{"command": "repl_open",
"caption": "Clojure Trampoline",
"id": "repl_clojure",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": {"windows": ["lein.bat", "trampoline", "run", "-m", "clojure.main"],
"linux": ["lein", "repl"],
"osx": ["lein", "repl"]},
"soft_quit": "\n(. System exit 0)\n",
"cwd": {"windows":"$file_path",
"linux": "$file_path",
"osx": "$file_path"},
"syntax": "Packages/Clojure/Clojure.tmLanguage",
"external_id": "clojure",
"extend_env": {"INSIDE_EMACS": "1"}
}
},
{"command": "clojure_auto_telnet_repl",
"id": "repl_clojure_telnet",
"caption": "Clojure-Telnet"}]}
]
}]
}
]