Fork me on GitHub

is there a way to unbind the <return> key from cider repl?


From the docs:

(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)


It’s always nice to see someone reads them. 🙂

😄 3

Is it possible for a macro to tell cider which string is a docstring? something like :style/indent.


@doglooksgood Currently not. What’s your usecase?


I just curious, the docstring for user macros, can't get a correct highlight. anyway, this is not important.


Ah, I think I misunderstood you. clojure-mode has some degree of configurability about this, but I guess it depends on the macro.


I want to remap  M-e to eval last sexp. how to do it? please help. I tried this `(define-key cider-repl-mode-map (kbd "M-e") #'cider-eval-last-sexp )`   but it did not work (edited) This is the error Symbol's value as variable is void: cider-repl-mode-map


trying (require 'cider) or (require 'cider-repl) before defining it.


thank you.

(require 'cider-eval)
(define-key clojure-mode-map (kbd "M-e") #'cider-eval-last-sexp )

Scott Silver23:06:45

If you’re working in some namespace

(ns some.namespace
    [clojure.spec.alpha :as s]))

(s/fdef add-pos-ints
  :args (s/cat :a pos? :b pos?))

(defn add-pos-ints [a b]
  (+ a b))
and then enable spec instrumentation in the repl:
some.namespace> (require '[clojure.spec.test.alpha :as stest])
some.namespace> (stest/instrument)
then spec will give you the errors you’d expect:
some.namespace> (add-pos-ints 1 -1)

-- Spec failed --------------------

Function arguments

  (... -1)

should satisfy


Detected 1 error
but if you then reevaluate the buffer (say by calling cider-eval-buffer), then instrumentation no longer gives you the errors you’d expect:
some.namespace> (add-pos-ints 1 -1)
=> 0
this makes sense with the way instrumentation works, but it’s a frustrating development experience to have to call (stest/instrument) every time you reevaluate something. is there any way to have spec instrumentation always be “on” in Cider? for instance, is there some way to define a hook that would get called whenever you call cider-eval-buffer , so you could automatically call (stest/instrument) ?