Doom Cider keybindings

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
  (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)

Replace foo-bar with the lisp function that you need.

1 Like

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 :slight_smile:

@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)
  (defroutes 'defun)
  (GET 2)
  (POST 2)
  (PUT 2)
  (DELETE 2)
  (HEAD 2)
  (ANY 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.