Fork me on GitHub
#cider
<
2023-07-07
>
vemv10:07:27

ℹ️ we've released refactor-nrepl / clj-refactor.el 3.7.1, with @dgtized's priceless contributions. If you are a cljr-slash fan, you can try its revamped version by customizing cljr-slash-uses-suggest-libspec t . For instance, if you type priority/ , you will now get .cljc completions when suitable:

#?(:clj [clojure.data.priority-map :as priority]
   :cljs [tailrecursion.priority-map :as priority])
There's smart, well-tested logic behind. This is still beta - feedback welcome!

👍 10
2
DeepReef1117:07:34

How to bind key for cider in doom emacs? I have the following: (map! :prefix "SPC e" "e" #'cider-eval-defun-at-point) But it doesn't work. Plus I think I may need to add something else to make ti works while in clojure file or something. I want to bind SPC e e

aisamu17:07:37

On your doom installation folder (usually ~/.emacs.d), go to modules/lang/clojure/config.el for some examples!

2
DeepReef1118:07:04

Does :localleader means SPC m (by default) ?

DeepReef1118:07:31

Is localleader something defined in doom emacs or specific to cider?

aisamu18:07:44

IIUC, that’s specific to doom

aisamu18:07:16

localleader is what you get with ,

aisamu18:07:52

leader, SPC

DeepReef1118:07:24

Ok, and spc m is local leader as a mode for keybinding

DeepReef1118:07:38

Not specific to cider

aisamu18:07:50

Yup! All major modes have local leaders, also accessible via ,

aisamu18:07:21

(map! (:localleader
        (:map (clojure-mode-map clojurescript-mode-map clojurec-mode-map)
          "'"  #'cider-jack-in-clj
This means that, when clojure-mode is active, , ' will invoke cider-jack-in-clj

DeepReef1118:07:26

So if I want to map spc e e, it would be (map! :leader :prefix "e" "e" #'fx)

aisamu18:07:57

For leader definitions, you can find examples under modules/config/default/+evil-bindings.el

2
aisamu18:07:46

IIRC you can just

(map! :leader "e e" #'fx)

DeepReef1118:07:48

Great it works, thanks a lot!

aisamu18:07:42

But note that a leader will always be active (i.e. SPC e e will try to invoke cider even if you’re visiting a markdown file)

aisamu18:07:06

If you’re using the doom module for clojure, that’s already bound for you:

aisamu18:07:45

This is the output of running SPC h f and typing the search query

DeepReef1118:07:29

Yes I know, I wanted to remap because spc e e makes more sens to me

DeepReef1118:07:16

And if I understand properly, this: (:map (clojure-mode-map clojurescript-mode-map clojurec-mode-map) means that it loads the map only when it is clojure?

DeepReef1118:07:05

Oh seems like not... have to find that

DeepReef1118:07:55

I suppose it is because I would need to use the localleader?

aisamu18:07:42

Yes, but indirectly. It adds the bindings to those keymaps… which are only active when their respective modes are active

2
practicalli-johnny19:07:02

https://github.com/practicalli/doom-emacs-config/blob/main/%2Bclojure.el has lots of examples of key bindings for Clojure There are other key bindings in +bindings.el file