You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/modules/ROOT/pages/usage/code_evaluation.adoc
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -275,6 +275,34 @@ Additionally, there's the variable `cider-redirect-server-output-to-repl` that c
275
275
276
276
NOTE: The redirection functionality is implemented in `cider-nrepl` as nREPL middleware. If you're using CIDER without `cider-nrepl` no output redirection is going to take place.
277
277
278
+
279
+
280
+
=== Storing eval results
281
+
282
+
By default CIDER stores the return value of the most recent evaluation command
283
+
in the text register `e`. You can access these contents via `insert-register`
284
+
(kbd:[C-x r i]).
285
+
286
+
This is often useful for closer inspection or textual manipulation of a
287
+
transiently displayed eval result, without having to re-evaluate the form with a
288
+
specialized command like `cider-insert-last-sexp-in-repl`.
289
+
290
+
You can customize which register is used with the variable `cider-eval-register`, or set
291
+
it to `nil` to disable the feature.
292
+
293
+
[source,lisp]
294
+
----
295
+
(setq cider-eval-register nil)
296
+
----
297
+
298
+
TIP: The built-in xref:debugging/inspector.adoc[inspector] can be used to view
299
+
and navigate through complex nested results.
300
+
301
+
You can also use the command `cider-kill-last-result`(kbd:[C-c C-v k]) after any
302
+
eval command to store its result in the kill ring. This works even when the
303
+
`cider-eval-register` feature is disabled.
304
+
305
+
278
306
== Keybindings
279
307
280
308
You might have noticed that CIDER typically has 2-3 different keybindings for
@@ -383,6 +411,10 @@ kbd:[C-u C-c C-c]
383
411
| `cider-load-all-files`
384
412
| kbd:[C-c C-M-l]
385
413
| Load (eval) all Clojure files below a directory.
414
+
415
+
| `cider-kill-last-result`
416
+
| kbd:[C-c C-v k]
417
+
| Save the last evaluated result into the kill ring.
386
418
|===
387
419
388
420
TIP: You'll find all evaluation commands and their keybindings in the `CIDER Eval` menu.
0 commit comments