Use evil-cleverparens in lisp modes, and electric-pair elsewhere

This commit is contained in:
Alexander Rosenberg 2024-09-14 15:29:37 -07:00
parent af9fc9efdf
commit 7b96dad1f8
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

11
init.el
View File

@ -321,14 +321,19 @@ directory. Otherwise, run `find-file' on that file."
("C-c C-+" . evil-numbers/inc-at-pt-incremental)
("C-c C--" . evil-numbers/dec-at-pt-incremental)))
(use-package evil-cleverparens
:hook ((prog-mode . evil-cleverparens-mode)
:hook ((prog-mode . my/-enable-evil-cleverparens)
(evil-cleverparens-mode . paredit-mode))
:bind (:map paredit-mode-map
("C-<return>" . paredit-RET)
("C-RET" . paredit-RET))
:custom
(eldoc-add-command 'paredit-RET)
(evil-cleverparens-use-s-and-S nil))
(evil-cleverparens-use-s-and-S nil)
:config
(defun my/-enable-evil-cleverparens ()
(if (member major-mode '(common-lisp-mode emacs-lisp-mode))
(evil-cleverparens-mode 1)
(electric-pair-local-mode 1))))
;; make lisp editing nicer
(use-package aggressive-indent
@ -1655,7 +1660,7 @@ one of the normal rainbow-delimiters-depth-N-face faces."
(save-match-data
(let* ((base-face (rainbow-delimiters-default-pick-face depth match loc))
(base-name (symbol-name base-face)))
(if (and adjust-parens-mode
(if (and (or evil-cleverparens-mode adjust-parens-mode)
(eq ?\) (char-syntax
(elt (buffer-substring-no-properties loc (1+ loc)) 0)))
(string-match (rx string-start "rainbow-delimiters-depth-"