CIDER comes with a powerful REPL that complements the interactive
development functionality in
cider-mode. Using the CIDER REPL you
can experiment with your running program, test functions, or just
explore a new library you're interested in using. The CIDER REPL offers a number of advanced features:
- font-locking (the same as in
- quick access to many CIDER commands (e.g. definition and documentation lookup, tracing, etc)
- (optional) pretty-printing of evaluation results
- eldoc support
- highly customizable REPL prompt
Interacting with the REPL
Interacting with CIDER's REPL is pretty simple - most of the time you'd just write expressions there and press RET to evaluate them.
But the REPL is a bit more powerful than that and it allows you to do some things that might not be available in other Clojure REPLs. Some examples of such things would be:
- You can close an incomplete expression with C-Ret
- You can enter a multi-line expression by pressing C-j at the end of each line
- You can quickly jump to the definition of a symbol (.) or to its documentation (C-c C-d d)
- You can clear the output of the last expression with C-c C-o
- You can clear the REPL buffer with C-u C-c C-o
- You can jump between your source buffers and the REPL with C-c C-z
- You can jump between your Clojure and ClojureScript REPLs with C-c M-o
On top of this the REPL is extremely configurable and you can tweak almost every aspect of it.
If you accidentally try to evaluate something that's going to take a lot of time (if it finishes at all), you can interrupt the rouge evaluation operation by pressing C-c C-c.
Note that this is different from the keybinding for interrupting evaluations in source buffers, namely C-c C-b.
Quitting a REPL
When you're done with a REPL you can dispose of it with C-c C-q.
Please, avoid killing REPL buffers with C-c C-k
Unfortunately the REPL doesn't handle very well big output and they can cause slowdowns and even lockups.
Make sure to clean your REPL buffers from time to time if you notice any slowdowns related to lots of
content in the REPL. It's also prudent to configure result printing with some reasonable setting for
cider-pprint-options if you're making use of pretty-printing).