Your Clojure code can be evaluated in the REPL buffer or in the code buffer itself.
Some common workflows are to write code in the clojure buffer and then either:
- Evaluate expressions in the clojure code buffer (results inline)
- Evaluate expressions in the clojure code buffer and send to REPL buffer
- Evaluate expressions in the REPL buffer
- Live evaluation with Enlighten mode
This section will give examples of these common workflows.
I prefer to evaluate in the code buffer. I also have a section at the bottom of the file for REPL experiment code.
The evaluation menu for Clojure is available via
, e or
Evaluation commands for Clojure are:
|Vim Normal||Major mode||Description|
||Evaluate all the code in the current buffer|
||Evaluate code within the highlighted region|
||Evaluate the previous expression and print the result|
||Evaluate the current expression and print the result|
||Evaluate the current expression and print the result as a comment|
||Open a new buffer and print the result of the previous expression|
||Toggle CIDER Enlighten mode, showing intermediate values|
Displaying large results
If the evaluation of a function or symbol returns a large result, eg. a large map, then use
cider-pprint-eval-last-sexp to show the result in a separate buffer.
, e P