spacemacs

Spacemacs docs: http://develop.spacemacs.org/doc/DOCUMENTATION.html http://develop.spacemacs.org/layers/+lang/clojure/README.html https://practicalli.github.io/spacemacs/
jumar 2020-09-24T06:54:47.003700Z

What's the best way to change keybinding for C-M-k? Specifically for clojure/lisp buffers. It used to work as kill-sexp but it doesn't work that way anymore in a clojure buffer (it still works properly in the REPL buffer); instead it's bound to evil-mc-make-cursor-move-prev-line which is very confusing for me and next to useless. I tried

(global-set-key  (kbd "C-M-k") 'kill-sexp)
=> has no effect (overridden?)
(define-key evil-mode (kbd "C-M-k") 'kill-sexp)
doesn't work because it needs a keymap (I don't know which one)

practicalli-john 2020-09-24T10:23:55.003800Z

@jumar If you are using evil editing style, then try (evil-global-set-key 'normal "C-M-k" 'kill-sexp) to over-ride the evil keybinding for Evil normal state. Replace normal with insert if you want that keybinding to work when in Evil insert state. Or you can use SPC k d x to call sp-kill-sexp , SPC k d w to kill word and SPC k d s to kill a symbol. Or you can use Emacs or hybrid editing style if you do not make use of evil style editing.

jumar 2020-09-25T12:05:29.008100Z

Yeah, I mean, it works with the insert mode but what I'd like to make it work in normal mode too - for that I cannot do it it seems.

jumar 2020-09-24T18:54:10.004100Z

Thanks for the tip - the evil-global-set-key fails though:

(evil-global-set-key 'normal "C-M-k" 'kill-sexp)
*** Eval error ***  Key sequence C - M - k starts with non-prefix key C

jumar 2020-09-24T18:55:20.004300Z

(with 'insert mode it seems to work)

👍 1
zane 2020-09-24T23:21:30.005200Z

Wow, is it just me or does , e p e (`cider-pprint-eval-last-sexp`) print records as if they were maps?

practicalli-john 2020-09-24T23:43:40.007200Z

@zane the , e p menu has keybindings that pretty print the evaluated results, added back in March https://github.com/syl20bnr/spacemacs/pull/13421 I think of Records in Clojure as custom typed maps, so not surprised they print as maps. Would be interested in seeing examples if you can share. Thanks.

zane 2020-09-24T23:50:51.007500Z

clojure.pprint/pprint also prints records as maps, so I suppose the behavior is at least consistent. That was a huge surprise to me, though.

zane 2020-09-24T23:51:37.007700Z

(defrecord Test [x y])
(->Test 0 1)
pretty-prints as
{:x 0, :y 1}

zane 2020-09-24T23:52:07.007900Z

I would have expected

#user.Test{:x 0, :y 1}