7
votes

I started using Clojure with leiningen (and now boot).

Now I sometimes want to get quickly to a Clojure{Script} CIDER REPL in Emacs to execute just a few instructions. I don't want to create a project.clj file for that, since I just want a throwaway REPL.

Is there a way to get a Clojure REPL, for instance in the *scratch* buffer ?

3

3 Answers

6
votes

well, you can execute M-x cider-jack-in anywhere you want, even with no project.clj in path. This works for me.

4
votes

You can just type lein repl in the friendly console / shell / terminal right next to you -- no project.clj required. This will start a REPL as expected, to which you can then connect from Emacs via M-x cider-connect (which in recent versions will handily suggest host and port to connect to). M-x cider-jack-in basically does the same thing (i.e. lein repl) behind the scenes.

I'm not a boot user, but according to the boot wiki for leiningen users it should be possible to call boot repl -s.

0
votes

Use M-x cider-jack-in, and if you don't want it to warn you that you're running cider-jack-in without a Clojure project, add the following to your emacs.d/init.el:

(setq cider-allow-jack-in-without-project t)