mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-27 14:23:43 -05:00
Refactor smartparens default rules
Move them to config/default, but move single-lang-specific ones to their respective modules.
This commit is contained in:
@@ -157,10 +157,7 @@ fundamental-mode) for performance sake."
|
||||
sp-navigate-consider-sgml-tags nil))
|
||||
(add-hook 'after-change-major-mode-hook #'doom|disable-smartparens-navigate-skip-match)
|
||||
|
||||
;; smartparenss conflicts with evil-mode's replace state
|
||||
(add-hook 'evil-replace-state-entry-hook #'turn-off-smartparens-mode)
|
||||
(add-hook 'evil-replace-state-exit-hook #'turn-on-smartparens-mode)
|
||||
|
||||
;; autopairing in `eval-expression' and `evil-ex'
|
||||
(defun doom|init-smartparens-in-eval-expression ()
|
||||
"Enable `smartparens-mode' in the minibuffer, during `eval-expression' or
|
||||
`evil-ex'."
|
||||
@@ -169,16 +166,9 @@ fundamental-mode) for performance sake."
|
||||
(add-hook 'minibuffer-setup-hook #'doom|init-smartparens-in-eval-expression)
|
||||
(sp-local-pair 'minibuffer-inactive-mode "'" nil :actions nil)
|
||||
|
||||
(sp-local-pair sp--html-modes "<!--" "-->"
|
||||
:actions '(insert) :post-handlers '(("| " "SPC")))
|
||||
|
||||
(sp-local-pair
|
||||
'(js2-mode typescript-mode rjsx-mode rust-mode
|
||||
c-mode c++-mode objc-mode java-mode php-mode
|
||||
css-mode scss-mode less-css-mode stylus-mode)
|
||||
"/*" "*/"
|
||||
:actions '(insert)
|
||||
:post-handlers '(("| " "SPC") ("|\n*/[i][d-2]" "RET") ("\n* ||\n*/[i][d-2]" "*")))
|
||||
;; smartparenss conflicts with evil-mode's replace state
|
||||
(add-hook 'evil-replace-state-entry-hook #'turn-off-smartparens-mode)
|
||||
(add-hook 'evil-replace-state-exit-hook #'turn-on-smartparens-mode)
|
||||
|
||||
(smartparens-global-mode +1))
|
||||
|
||||
|
Reference in New Issue
Block a user