Start a new Clojure REPL
Spacemacs can start a REPL for the current Clojure project, calling out to the Clojure CLI tools (
deps.edn), Leiningen (
project.clj) or Boot (
boot.build) based on which configuration file is found in the root of the project. A prompt is displayed if there are multiple project configuration files to choose from.
You can run the following types of REPL's
cider-jack-in-cljfor Clojure on the JVM
cider-jack-in-cljsfor a ClojureScript REPL
cider-jack-in-clj&cljsfor both the above (full stack)
Open or select a Clojure buffer, this can be an
||start a REPL, selecting the type|
Once the REPL starts, evaluate expressions using the source code buffer.
Start REPL with deps.edn aliases
SPC u ,' or
SPC u , s i will start a Clojure REPL, showing an editable prompt containing the full command used to start the REPL process. Edit the command to include the required aliases after the
clojure executable name.
Use .dir-locals.el to configure REPL startup
Aliases and configuration that customize the REPL startup can be added to a
.dir-locals.el file in the root of the Clojure project.
SPC p e creates or opens a
.dir-locals.el file in the root of the project. A helm prompt also allows for adding entries into the file.
:test aliases to
cider-clojure-cli-global-options and these aliases will always be included when running a REPL from Spacemacs
((clojure-mode . ((cider-clojure-cli-global-options . "-A:dev:test"))))
Clojure projects contains further examples of configuring the REPL startup.
Common REPL start / restart keybindings
||start a REPL, selecting the type (
||browse active REPL's (
||show information about the current REPL (
||restart the REPL, quit and jack-in. (
||quit the REPL (
||refresh stale code and load new code into the REPL (
||force reload the current namespaces in the REPL (