I just switched to Doom from Spacemacs. Has anyone customized the key bindings in Doom for Cider yet? I’m looking for inspiration.
The Doom Emacs lang/clojure layer has a list of key bindings:
Is that what you’re looking for?
There’s also the Emacs Lisp source: doom-emacs/config.el at develop · hlissner/doom-emacs · GitHub
Thank you @teodorlu ! That helps. I will probably add a key binding for “eval to comment”. Did you customize your key bindings ?
I have not added or modified any of my chords for Cider per se, but I did change them for the smartparens package. I already had the muscle memory for certain combos so the doom defaults were driving me bonkers!
I used the
use-package! form to override the key mappings like so:
(use-package! smartparens :init (map! :map smartparens-mode-map "C-M-f" #'sp-forward-sexp "C-M-b" #'sp-backward-sexp "C-M-u" #'sp-backward-up-sexp "C-M-d" #'sp-down-sexp "C-M-p" #'sp-backward-down-sexp "C-M-n" #'sp-up-sexp "C-M-s" #'sp-splice-sexp "C-M-." #'sp-forward-slurp-sexp "C->" #'sp-forward-barf-sexp "C-M-," #'sp-backward-slurp-sexp "C-<" #'sp-backward-barf-sexp))
Although if you just want to add one or two you could probably map it similar to this;
(map! :after cider-repl-mode "C-c C-M-e" #'foo-bar)
foo-bar with the lisp function that you need.
Not really. I’ve got some lines in my
config.el, but I haven’t made any changes to key bindings. When evaluating to coments, i
M-x and write the command.
I’ve been thinking that I should take paredit/smartparens more seriously, but that hasn’t happened yet
@gneissguise seems to have, though.
(setq clojure-toplevel-inside-comment-form 't) (add-hook 'clojure-mode-hook 'enable-paredit-mode) (add-hook 'cider-repl-mode-hook 'enable-paredit-mode) (add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode) (require 'clojure-mode) (define-clojure-indent (defroutes 'defun) (GET 2) (POST 2) (PUT 2) (DELETE 2) (HEAD 2) (ANY 2) (OPTIONS 2) (PATCH 2) (rfn 2) (let-routes 1) (context 2) (for-all 1))
Hooray for the Spacemacs migrants! I still have my
.spacemacs around, haven’t moved all of it over to Doom, even though I’ve been using Doom for about a year now.
I’m guessing you might get more answers in the Doom discord, there’s a #programming channel.
I’m more used to the spacemacs key bindings. I ended up doing this:
;; mapping part of the Spacemacs lisp key map: ;; https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#editing-lisp-code ;; https://rameezkhan.me/adding-keybindings-to-doom-emacs/ (map! :leader (:prefix-map ("k" . "smartparens-mode") :desc "sp-forward-slurp-sexp" "s" #'sp-forward-slurp-sexp :desc "sp-forward-sexp" "L" #'sp-forward-sexp :desc "sp-backward-sexp" "H" #'sp-backward-sexp ;; "C-M-u" #'sp-backward-up-sexp ;; "C-M-d" #'sp-down-sexp ;; "C-M-p" #'sp-backward-down-sexp ;; "C-M-n" #'sp-up-sexp ;; "C-M-s" #'sp-splice-sexp :desc "sp-backward-slurp-sexp" "S" #'sp-backward-slurp-sexp :desc "sp-backward-barf-sexp" "B" #'sp-backward-barf-sexp))