This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-20
Channels
- # announcements (1)
- # babashka (32)
- # beginners (100)
- # cider (43)
- # clj-kondo (4)
- # cljdoc (3)
- # cljs-dev (5)
- # cljsjs (2)
- # cljsrn (22)
- # clojure (170)
- # clojure-australia (27)
- # clojure-europe (25)
- # clojure-nl (3)
- # clojure-uk (76)
- # clojurescript (127)
- # conjure (14)
- # core-matrix (1)
- # cursive (9)
- # datomic (6)
- # defnpodcast (1)
- # emacs (32)
- # events (1)
- # expound (77)
- # fulcro (30)
- # graalvm (21)
- # graalvm-mobile (30)
- # helix (4)
- # honeysql (1)
- # hyperfiddle (1)
- # jackdaw (8)
- # jobs (6)
- # kaocha (1)
- # leiningen (4)
- # lsp (16)
- # malli (46)
- # meander (4)
- # off-topic (19)
- # pathom (10)
- # podcasts-discuss (1)
- # portal (2)
- # re-frame (7)
- # reagent (2)
- # releases (1)
- # remote-jobs (11)
- # rewrite-clj (8)
- # shadow-cljs (9)
- # tools-deps (243)
- # vim (1)
Hey guys, so I’m new to emacs and I’m coming from a vim background. I’ve install doom emacs and it’s great definitely got me up and going much quicker than I would have otherwise but there is a couple of niggle things I’d still like to change. Ideally I want to change some of the evil mode bindings, swapping ; and : for instance, but emacs seems to have a rather complicated way of setting that up as far as I can tell. Could anyone point me in the right direction?
For Doom, isn’t it a case of putting (define-key! ";" #'whatever)
in ~/.doom.d/config.el
? (Unless Doom has rebound C-h c
, you can use C-h c :
to find out what command : is currently sending… otherwise M-x describe-key-briefly
, followed by :
)
Yeah honestly I have no idea 😅 I’ve been googling for a few hours on it and I’m finding it really hard to just find any definitive way to do it
Or maybe it’s that there is so much information about doing it that I don’t feel confident doing any of them..
https://github.com/hlissner/doom-emacs/blob/develop/modules/config/default/+evil-bindings.el has
(map! :leader
:desc "Eval expression" ";" #'pp-eval-expression
:desc "M-x" ":" #'execute-extended-command
...
So if those are the ones you want to swap, you should be able to copy that into your config.el
, and change it
So if I was to do this with a completely unrelated keybinding where would I start to figure out how to rebind it?
Evil also provides evil-global-set-key
, which is what you want here, I think: (evil-global-set-key 'normal ";" 'execute-extended-command)
, if you want to use evil’s mechanism, rather than Doom’s
It doesn’t give you the exact elisp, but it tells you the keys, the command, the map, and the file
In this case there are multiple ways of doing it because you’ve added Doom onto Emacs, and Doom is using evil mode - so you have to learn some combination of emacs, doom and evil mode
I imagine what I’d do is just copy whatever binding I find and replace it how I want it. That is until I start to understand it a little more
Doom changes the learning curve, I guess - you get a nice setup out of the box, that’s both easier and harder to customise
Yeah part of the reason I choose it is that I can get going quicker but I might downgrade later on when I understand things more
I really recommend you join the doom discord, they are super helpful over there.