我使用以下方法安装了Leiningen Clojure项目工具: brew install leiningen
(REPL工作正常) .
我想用Vim写一些Clojure代码,所以我安装了以下插件:
我打开了三个终端控制台并按此顺序执行命令:
-
lein new compojure my-project
-
lein repl
-
cd my-project && vim
在Vim中,我首先连接到REPL ...
:Connect nrepl://127.0.0.1:60356
...然后我打开 my-project/src/my_project/handler.clj
文件并按 cpp
(我认为别名为 :Eval
,而我的光标位于第一个左括号的第一个字符上 .
此时我收到以下错误:
FileNotFoundException Could not locate my_project/handler__init.class or my_project/handler.clj on classpath: clojure.lang.RT.load (RT.java:443)
我找不到合适的解决方案了吗?
1 回答
为了使lein正确设置类路径,必须在项目目录中启动它 . 在启动lein repl之前将目录更改为my-project目录 .