Turn smartparens-strict-mode ON for clojure-mode

I noticed that smartparens-strict-mode is not officially supported in Doom, however for coding in Clojure this feature is mandatory for me. I’ve been using the following configuration:

(after! smartparens
  (add-hook 'clojure-mode-hook #'smartparens-strict-mode))

It’s necessary to rebind the DEL key because even if smartparens-strict-mode is enabled in the clojure-mode the DEL function is bound to evil-delete-backward-char-and-join which does not respect the strict requirements.

(map! :map clojure-mode-map
      "DEL" #'sp-backward-delete-char)

Hope this is helpful to other fellow clojurists!

4 Likes

Have you tried evil-cleverparens or evil-smartparens? It has mostly solved all my lisp + evil + structural editing needs. I use it with

(add-hook! clojure-mode-hook #'(evil-cleverparens-mode
                                evil-smartparens-mode))

Thanks for the suggestion! I’ll be using this package for some weeks to see how it goes. I know the amount of packages used by Doom but I remove lots of them and I like to rely on a minimal possible amount.

Things we do for no reason :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.