Fix smartparens config

This commit is contained in:
Jeremy Dormitzer 2020-02-06 12:46:35 -05:00
parent 89ecc67735
commit e04175ccdd

View File

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