1
votes

I'm following the clojure tutorial here and it shows me how to execute one line of clojure code in the repl by invoking C-x C-e at the end of the line. Now how would I execute more than 1 line of clojure code...for example...if I was in a clojure file with lots of code but I only wanted to execute a subset in the REPL....any way to do that?

eg.

...
...
(defn hello-world
 []
 (printf "Hello World")
)
(hello-world)
;; I'd like to execute the previous 5 lines with a key combination
...
...

```

2
I think you meant C-x C-e, which is what the tutorial uses. Also, could you clarify your code example—what are you trying to do?Dave Liepmann
The code sample defines a method hello-world and invokes it. I'll correct the C-x C-eudit

2 Answers

1
votes

The shortcut C-c C-c executes the entire sexp your on, the top-level form. see all shortcuts for cider here

1
votes
  1. Select all the sexps you want to evaluate.
  2. M-x cider-eval-regionto evaluate all those statements in order.