From b97b93158812784f35ccc98a55565cd8c603765a Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Tue, 7 Jan 2020 09:45:37 -0500 Subject: [PATCH] Switch out paredit for smartparens --- emacs/init.org | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 51a8160..cfcd337 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -999,27 +999,23 @@ Store backups and autosaves in a centralized place. This should really be the de (setq backup-directory-alist '(("." . "~/.emacs.d/backups"))) #+END_SRC -* Paredit/Parinfer -Paredit enables structured editing of s-expressions +* Smartparens/Parinfer +Smartparens enables structured editing of s-expressions and other pairs: #+BEGIN_SRC emacs-lisp - (use-package paredit - :hook ((emacs-lisp-mode . enable-paredit-mode) - (lisp-mode . enable-paredit-mode) - (clojure-mode . enable-paredit-mode) - (cider-repl-mode . enable-paredit-mode) - (ielm-mode . enable-paredit-mode) - (scheme-mode . enable-paredit-mode) - (geiser-repl-mode . enable-paredit-mode) - (slime-repl-mode . enable-paredit-mode))) + (use-package smartparens + :hook ((prog-mode . smartparens-strict-mode))) + (use-package evil-smartparens + :after (evil smartparens) + :hook ((smartparens-enabled . evil-smartparens-mode))) (jdormit/define-prefix "l" "lisp") (jdormit/define-prefix "lw" "wrap") - (leader-def-key "lwr" 'paredit-wrap-round) - (leader-def-key "lws" 'paredit-wrap-square) - (leader-def-key "lwc" 'paredit-wrap-curly) - (leader-def-key "ls" 'paredit-forward-slurp-sexp) - (leader-def-key "lb" 'paredit-forward-barf-sexp) + (leader-def-key "lwr" 'sp-wrap-round) + (leader-def-key "lws" 'sp-wrap-square) + (leader-def-key "lwc" 'sp-wrap-curly) + (leader-def-key "ls" 'sp-forward-slurp-sexp) + (leader-def-key "lb" 'sp-forward-barf-sexp) #+END_SRC Parinfer infers parens from indentation and vice-versa: @@ -1030,7 +1026,6 @@ Parinfer infers parens from indentation and vice-versa: (setq parinfer-extensions '(defaults pretty-parens evil - paredit smart-tab smart-yank)) :hook ((clojure-mode . parinfer-mode)