2

The way that I'm reloading the nrepl in Clojure seems too bulky.

When I load a Clojure project and nrepl, I:

  • Create a keyboard macro to input and return something like (use 'my-namespace.core :reload).
  • Next I bind the keyboard macro to something else, usually C-tab.
  • Finally, every time I switch into the nrepl, I execute C-tab, and the repl reloads.

This seems like a lot of unnecessary work. I've looked around at getting the namespace programmatically, or with C-c C-e, but nothing seems to fit quite right.

Isn't there an easier way?

Thanks.

2
  • If you press , and then clear doesn't it do what you want? Alternatively, maybe , and then ns? Commented Sep 3, 2015 at 21:30
  • Those are nice, thanks, but they don't reload the repl, by which I mean load the saved s-expressions into the repl. So that if one newly wrote (def life-means? 42) in their file they would be able to save that file, write life-means? in the repl, and get back 42. Commented Sep 4, 2015 at 4:09

1 Answer 1

1

An easier way is to just load your current file:

(define-key clojure-mode-map
    (kbd "C-c C-l") 'cider-load-file)

It's also possible to keep (use 'my-namespace.core :reload) in your file, navigate there with isearch and C-c C-e.

Personally, I almost never use a REPL and evaluate either the whole buffer with C-c C-l or single expressions with e (via lispy).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.