REPL Keybindings

Here’s a list of the keybindings that are available in CIDER’s REPL:

Keyboard shortcut Description

RET

Evaluate the current input in Clojure if it is complete. If incomplete, open a new line and indent. If the current input is a blank string (containing only whitespace including newlines) then clear the input without evaluating and print a fresh prompt. If invoked with a prefix argument is given then the input is evaluated without checking for completeness.

C-RET

Close any unmatched parenthesis and then evaluate the current input in Clojure.

C-j

Open a new line and indent.

C-c C-o

Remove the output of the previous evaluation from the REPL buffer. With a prefix argument it will clear the entire REPL buffer, leaving only a prompt.

C-c M-o

Switch between the Clojure and ClojureScript REPLs for the current project.

C-c C-u

Kill all text from the prompt to the current point.

C-c C-b
C-c C-c

Interrupt any pending evaluations.

C-up
C-down

Go to to previous/next input in history.

M-p
M-n

Search the previous/next item in history using the current input as search pattern. If M-p/M-n is typed two times in a row, the second invocation uses the same search pattern (even if the current input has changed).

M-s
M-r

Search forward/reverse through command history with regex.

C-c C-n
C-c C-p

Move between the current and previous prompts in the REPL buffer. Pressing RET on a line with old input copies that line to the newest prompt.

TAB

Complete symbol at point.

C-c C-d d
C-c C-d C-d

Display doc string for the symbol at point. If invoked with a prefix argument, or no symbol is found at point, prompt for a symbol

C-c C-d j
C-c C-d C-j

Display JavaDoc (in your default browser) for the symbol at point. If invoked with a prefix argument, or no symbol is found at point, prompt for a symbol.

C-c C-d r
C-c C-d C-c

Lookup symbol in ClojureDocs.

C-c C-d a
C-c C-d C-a

Apropos search for functions/vars.

C-c C-d f
C-c C-d C-f

Apropos search for documentation.

C-c C-z

Switch to the previous Clojure buffer. This complements C-c C-z used in cider-mode.

C-c M-i

Inspect expression. Will act on expression at point if present.

C-c M-n

Select a namespace and switch to it.

C-c C-.

Jump to some namespace on the classpath.

C-c M-t v

Toggle var tracing.

C-c M-t n

Toggle namespace tracing.

C-c C-t t
C-c C-t C-t

Run test at point.

C-c C-t a
C-c C-t C-a

Re-run the last test you ran.

C-c C-t n
C-c C-t C-n

Run tests for current namespace.

C-c C-t l
C-c C-t C-l

Run tests for all loaded namespaces.

C-c C-t p
C-c C-t C-p

Run tests for all project namespaces. This loads the additional namespaces.

C-c C-t r
C-c C-t C-r

Re-run test failures/errors.

C-c C-t b
C-c C-t C-b

Show the test report buffer.

C-c C-q

Quit the current nREPL connection. With a prefix argument it will quit all connections.

There’s no need to memorize this list. In any REPL buffer you’ll have a REPL menu available, which lists all the most important commands and their keybindings. You can also invoke C-h f RET cider-repl-mode to get a list of the keybindings for cider-repl-mode.

REPL Shortcuts

In the REPL you can also use "shortcut commands" by pressing , at the beginning of a REPL line. You’ll be presented with a list of commands you can quickly run (like quitting, displaying some info, clearing the REPL, etc). The character used to trigger the shortcuts is configurable via cider-repl-shortcut-dispatch-char. Here’s how you can change it to ;:

(setq cider-repl-shortcut-dispatch-char ?\;)