From e04175ccddb0ab41e68054fb7c0f475227412141 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 6 Feb 2020 12:46:35 -0500 Subject: [PATCH] Fix smartparens config --- emacs/init.org | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index cae75b9..b049e13 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -1337,19 +1337,20 @@ Smartparens enables structured editing of s-expressions and other pairs: Enable ES6 arrow functions in web-mode ("borrowed" from [[https://github.com/Fuco1/smartparens/issues/823#issuecomment-403019519][this GitHub comment]]): #+BEGIN_SRC emacs-lisp - (defun sp-after-equals-p (_id action _context) - (when (memq action '(insert navigate)) - (sp--looking-back-p "=>" 2))) + (with-eval-after-load 'smartparens + (defun sp-after-equals-p (_id action _context) + (when (memq action '(insert navigate)) + (sp--looking-back-p "=>" 2))) - (defun sp-after-equals-skip (ms mb _me) - (when (eq ms ">") - (save-excursion - (goto-char mb) - (sp--looking-back-p "=" 1)))) + (defun sp-after-equals-skip (ms mb _me) + (when (eq ms ">") + (save-excursion + (goto-char mb) + (sp--looking-back-p "=" 1)))) - (sp-local-pair '(web-mode) "<" nil - :unless '(:add sp-after-equals-p) - :skip-match 'sp-after-equals-skip-p) + (sp-local-pair '(web-mode) "<" nil + :unless '(:add sp-after-equals-p) + :skip-match 'sp-after-equals-skip-p)) #+END_SRC Parinfer infers parens from indentation and vice-versa: @@ -3769,6 +3770,7 @@ An alternative minibuffer completion framework: (leader-def-key "iu" #'counsel-unicode-char) (leader-def-key "iUt" #'counsel-load-theme) (leader-def-key "is" #'swiper) + (leader-def-key "ia" #'swiper-all) (leader-def-key "ff" #'counsel-find-file) (leader-def-key "oc" #'counsel-org-capture) (leader-def-key "bb" #'counsel-ibuffer)