Fork me on GitHub
#spacemacs
<
2021-05-12
>
craftybones06:05:10

If I want to use spacemacs, but plug directly into a Clojure CLI(not nrepl), what are my options?

practicalli-john08:05:04

As I understand it, a REPL is an external process that requires a protocol to connect. This is the case when running a repl with either Leiningen or Clojure CLI tools (i.e. cider-jack-in). nrepl is by far the most common protocol and enables a rich set of features via the Cider package. Other options I am aware of are socket REPL and prepl. Socket REPL is part of the Clojure library, so included in any project that has org.clojure/clojure as a dependency. https://github.com/clojure-emacs/inf-clojure is an Emacs project that uses Socket REPL to connect to a running REPL, providing what they describe as essential features (a sub-set of features you would get with Cider & nrepl). I am assuming this would be used instead of the Clojure layer, so you would need to add as additional-packages or create/find a private Spacemacs layer for inf-clojure.

practicalli-john08:05:47

https://github.com/practicalli/clojure-deps-edn#alternative-repls has examples of running a repl with different protocols, such as socket repl

practicalli-john08:05:45

https://oli.me.uk/clojure-socket-prepl-cookbook/ may give some insight into using these alternative protocols for connecting to a repl.