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)@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.
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.
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
(with 'insert
mode it seems to work)
Wow, is it just me or does , e p e
(`cider-pprint-eval-last-sexp`) print records as if they were maps?
@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.
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.
(defrecord Test [x y])
(->Test 0 1)
pretty-prints as
{:x 0, :y 1}
I would have expected
#user.Test{:x 0, :y 1}