Does clj-refactor work with jdk11? I get refactor-nrepl is unreachable.
I set https://github.com/robert-stuttaford/clj-cljs-app/ up on JDK11 and it works. Perhaps the answer you need is somewhere in how this is set up?
Finally, I deleted refactor-nrepl in .m2 . Cider re-downloaded it and now it works.
How do I bind a clojure eval to a shortcut? There is cider-read-and-eval
but if I call (cider-read-and-eval "(user/restart)")
, the command appears in the minibuffer and I have to additionally press Enter to eval it.
> Read a sexp from the minibuffer and output its result to the echo area. If VALUE is non-nil, it is inserted into the minibuffer as initial input.
you're entering a prompt for the minibuffer
Yes, but how do I avoid having to press enter?
you can't with that function. that's why i posted the docstring. that function is for reading from the minibuffer and a prompt. you will always end up in the minibuffer
Is there another function that would do that?
if you read the source of that function you can see all the things its doing. but its ultimately calling (cider-interactive-eval form)
there's some stuff relating to namespace but if you want just a simple thing that form there will do it
its making a new buffer, putting an ns form of whatever the current namespace is in the buffer you're calling it from, and then your form and calling eval on the form
Ah, great, thank you! I tried looking at the source but it seemed like a lot of stuff going on there.
read it again with that in mind. 1. get the current ns and make an ns form out of it "(ns %s") cider-current-namespace 2. get a buffer made just for this and erase it 3. make sure its in clojure-mode 4. if we have a ns form insert it 5. put our form in there 6. eval the form
i'm not sure why the form is in the buffer and in the interactive eval form but whatever ¯\(ツ)/¯