Fix smartparens config
This commit is contained in:
parent
89ecc67735
commit
e04175ccdd
@ -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]]):
|
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
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun sp-after-equals-p (_id action _context)
|
(with-eval-after-load 'smartparens
|
||||||
(when (memq action '(insert navigate))
|
(defun sp-after-equals-p (_id action _context)
|
||||||
(sp--looking-back-p "=>" 2)))
|
(when (memq action '(insert navigate))
|
||||||
|
(sp--looking-back-p "=>" 2)))
|
||||||
|
|
||||||
(defun sp-after-equals-skip (ms mb _me)
|
(defun sp-after-equals-skip (ms mb _me)
|
||||||
(when (eq ms ">")
|
(when (eq ms ">")
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char mb)
|
(goto-char mb)
|
||||||
(sp--looking-back-p "=" 1))))
|
(sp--looking-back-p "=" 1))))
|
||||||
|
|
||||||
(sp-local-pair '(web-mode) "<" nil
|
(sp-local-pair '(web-mode) "<" nil
|
||||||
:unless '(:add sp-after-equals-p)
|
:unless '(:add sp-after-equals-p)
|
||||||
:skip-match 'sp-after-equals-skip-p)
|
:skip-match 'sp-after-equals-skip-p))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Parinfer infers parens from indentation and vice-versa:
|
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 "iu" #'counsel-unicode-char)
|
||||||
(leader-def-key "iUt" #'counsel-load-theme)
|
(leader-def-key "iUt" #'counsel-load-theme)
|
||||||
(leader-def-key "is" #'swiper)
|
(leader-def-key "is" #'swiper)
|
||||||
|
(leader-def-key "ia" #'swiper-all)
|
||||||
(leader-def-key "ff" #'counsel-find-file)
|
(leader-def-key "ff" #'counsel-find-file)
|
||||||
(leader-def-key "oc" #'counsel-org-capture)
|
(leader-def-key "oc" #'counsel-org-capture)
|
||||||
(leader-def-key "bb" #'counsel-ibuffer)
|
(leader-def-key "bb" #'counsel-ibuffer)
|
||||||
|
Loading…
Reference in New Issue
Block a user