Better smarparens behaviour for braces

This commit is contained in:
Tristan Hume 2014-11-02 10:00:41 -05:00 committed by syl20bnr
parent d0136923d7
commit 21b6aa8832

View file

@ -1828,6 +1828,19 @@ DELETE-FUNC when calling CALLBACK.
(spacemacs//diminish smartparens-mode " (Ⓢ)")) (spacemacs//diminish smartparens-mode " (Ⓢ)"))
:config :config
(progn (progn
(defun spacemacs/smartparens-pair-newline (id action context)
(save-excursion
(newline)
(indent-according-to-mode)))
(defun spacemacs/smartparens-pair-newline-and-indent (id action context)
(spacemacs/smartparens-pair-newline id action context)
(indent-according-to-mode))
(sp-pair "{" nil :post-handlers
'(:add (spacemacs/smartparens-pair-newline-and-indent "RET")))
(sp-pair "[" nil :post-handlers
'(:add (spacemacs/smartparens-pair-newline-and-indent "RET")))
(sp-local-pair 'emacs-lisp-mode "'" nil :actions nil)))) (sp-local-pair 'emacs-lisp-mode "'" nil :actions nil))))
(defun spacemacs/init-smeargle () (defun spacemacs/init-smeargle ()