在 CIDER 中设置 Figwheel REPL 时遇到问题

Sol*_*xun 4 clojure cider nrepl figwheel

我刚刚开始尝试使用以下模板制作一个简单的 cljs 应用程序:

lein new figwheel someproject -- --reagent

我希望在 cider 中使用 REPL 进行 cljs 开发,就像我通常在普通 clj 项目中使用的方式一样,所以我做了一些研究并最终得到了这里:

https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl

我通读了说明,并验证了所有正确的依赖项都在 project.clj 中(无需更改任何内容,看起来模板添加了我需要的所有内容)。上面链接中的最后一步表明我需要将以下代码添加到我的 emacs 配置中:

(require 'cider)
(setq cider-cljs-lein-repl
      "(do (require 'figwheel-sidecar.repl-api)
           (figwheel-sidecar.repl-api/start-figwheel!)
           (figwheel-sidecar.repl-api/cljs-repl))")
Run Code Online (Sandbox Code Playgroud)

现在 - 我是一个 emacs 新手,所以我使用的设置仍然是我第一次从“ Clojure for the Brave and True ”中学到的:

https://github.com/flyingmachine/emacs-for-clojure

我试图首先将上面的代码片段放入 中~/.emacs.d/init.el,但是每当我尝试时M-x cider-jack-in ...,都没有cider-jack-in-clojurescript选择。我还尝试将代码片段放在 中~/.emacs.d/customizations/setup-clojure.el,这看起来更合乎逻辑,但结果相同。

我真的很想能够启动并运行这个 REPL,所以任何帮助将不胜感激。

Jur*_*nka 6

我通常使用普通cider-jack-in然后从 REPL 调用所有内容:

(use 'figwheel-sidecar.repl-api)
(start-figwheel!)
(cljs-repl)
Run Code Online (Sandbox Code Playgroud)

如果你想有两个 repl,你可以(cljs-repl)在通过cider-connect.

如果您刚开始使用 Emacs,我相信您最好的选择是 Spacemacs:http ://spacemacs.org/ 。如果您有兴趣,我写了一篇关于我的开发工作流程的博客文章视频