Skip to content

Commit 623c5c7

Browse files
committed
Extend a bit the section on basic REPL usage
1 parent 53dd5d5 commit 623c5c7

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

doc/repl/basic_usage.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,45 @@ explore a new library you're interested in using. The CIDER REPL offers a number
1111
* (optional) pretty-printing of evaluation results
1212
* eldoc support
1313
* highly customizable REPL prompt
14+
15+
## Interacting with the REPL
16+
17+
Interacting with CIDER's REPL is pretty simple - most of the time
18+
you'd just write expressions there and press <kbd>RET</kbd> to
19+
evaluate them.
20+
21+
But the REPL is a bit more powerful than that and it allows you to do some things that might not be available in
22+
other Clojure REPLs. Some examples of such things would be:
23+
24+
* You can close an incomplete expression with <kbd>C-Ret</kbd>
25+
* You can enter a multi-line expression by pressing <kbd>C-j</kbd> at the end of each line
26+
* You can quickly jump to the definition of a symbol (<kbd>.</kbd>) or to its documentation (<kbd>C-c C-d d</kbd>)
27+
* You can clear the output of the last expression with <kbd>C-c C-o</kbd>
28+
* You can clear the REPL buffer with <kbd>C-u C-c C-o</kbd>
29+
* You can jump between your source buffers and the REPL with <kbd>C-c C-z</kbd>
30+
* You can jump between your Clojure and ClojureScript REPLs with <kbd>C-c M-o</kbd>
31+
32+
On top of this the REPL is extremely configurable and you can tweak almost every aspect of it.
33+
34+
## Interrupting Evaluations
35+
36+
If you accidentally try to evaluate something that's going to take a lot of time (if it finishes at all), you
37+
can interrupt the rouge evaluation operation by pressing <kbd>C-c C-c</kbd>.
38+
39+
!!! Tip
40+
41+
Note that this is different from the keybinding for interrupting evaluations in source buffers,
42+
namely <kbd>C-c C-b</kbd>.
43+
44+
## Quitting a REPL
45+
46+
When you're done with a REPL you can dispose of it with <kbd>C-c C-q</kbd>.
47+
48+
Please, avoid killing REPL buffers with <kbd>C-c C-k</kbd>
49+
50+
## Known Limitations
51+
52+
Unfortunately the REPL doesn't handle very well big output and they can cause slowdowns and even lockups.
53+
Make sure to clean your REPL buffers from time to time if you notice any slowdowns related to lots of
54+
content in the REPL. It's also prudent to configure result printing with some reasonable setting for
55+
`*print-length*` and `*print-level*` (or `cider-pprint-options` if you're making use of pretty-printing).

0 commit comments

Comments
 (0)