5 Editor Integration
Editors and IDEs offer various degrees of REPL integration, providing a rich and interactive development workflow.
This section is a stub, you can help by expanding it.
Emacs
inf-clojure
Emacs has a built-in mode for communicating with a LISP REPL process, called
inferior-lisp
. It works by spinning up a subprocess, and then sending
forms to be evaluated to that process's standard input stream.
inf-clojure follows the same pattern, but is tailored for Clojure REPLs. Note that it does not use the nREPL protocol, it simply sends code back and forth, and so can't distinguish between a REPL return value, and output generated by the code.
CIDER
CIDER is the "everything but the kitchen sink" Clojure integration for Emacs. It provides an nREPL-based REPL, in-buffer evaluation, but also many extra features. It can do "jump-to-symbol" style code navigation, will show the signature of the function at point in the minibuffer, has shortcuts for consulting docstrings and javadocs, and much more.
Its basic features build upon the standard nREPL functionality, for more advanced uses it uses a Leiningen plugins which injects the cider-nrepl middleware, providing extra nREPL operations. (See nREPL: Custom Middleware)
clj-refactor
Not a REPL but worthy of mention because it's based on nREPL, this Emacs extension provides many powerful refactoring tools, "introduce let", "extract function", "add project dependency", etc.
Just like CIDER it uses a Leiningen plugin to inject the refactor-nrepl
middleware. When using cider-jack-in
this plugin will be added
automatically. If you're not using CIDER or launching your own nREPL server
then it's your responsibility to make sure this middleware is loaded.
Monroe
Monroe is an nREPL client for Emacs that fits into the sweet spot between
the minimalism of inf-clojure
and the mastodont that is CIDER
.
Install it with (package-install 'monroe)
and launch with M-x monroe
. It
will ask you for the location of the nREPL server, which you have to start
yourself, for instance with lein repl
.
Besides a REPL you get some source buffer interaction, like evaluating expressions and regions, and looking up documentation.