Merge pull request #585 from toctan/smartparens
Move smartparens pair definition out of hooks
This commit is contained in:
commit
2437b447d9
2 changed files with 23 additions and 19 deletions
|
@ -113,6 +113,11 @@ This functions should be added to the hooks of major modes for programming."
|
|||
;;
|
||||
;; (the final optional t sets the *append* argument)
|
||||
|
||||
;; smart curly braces
|
||||
(sp-pair "{" nil :post-handlers
|
||||
'(((lambda (&rest _ignored)
|
||||
(prelude-smart-open-line-above)) "RET")))
|
||||
|
||||
(defun prelude-prog-mode-defaults ()
|
||||
"Default coding hook, useful with any programming language."
|
||||
(when (and (executable-find ispell-program-name)
|
||||
|
@ -121,9 +126,6 @@ This functions should be added to the hooks of major modes for programming."
|
|||
(when prelude-guru
|
||||
(guru-mode +1))
|
||||
(smartparens-mode +1)
|
||||
(sp-pair "{" nil :post-handlers
|
||||
'(((lambda (&rest _ignored)
|
||||
(prelude-smart-open-line-above)) "RET")))
|
||||
(prelude-enable-whitespace)
|
||||
(prelude-local-comment-auto-fill)
|
||||
(prelude-font-lock-comment-annotations))
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
|
||||
(prelude-require-packages '(web-mode))
|
||||
|
||||
(require 'web-mode)
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.blade\\.php\\'" . web-mode))
|
||||
|
@ -44,13 +46,9 @@
|
|||
(add-to-list 'auto-mode-alist
|
||||
'("/\\(views\\|html\\|theme\\|templates\\)/.*\\.php\\'" . web-mode))
|
||||
|
||||
|
||||
|
||||
(eval-after-load 'web-mode
|
||||
'(progn
|
||||
(defun prelude-web-mode-defaults ()
|
||||
;; make web-mode play nice with smartparens
|
||||
(setq web-mode-enable-auto-pairing nil)
|
||||
|
||||
(sp-with-modes '(web-mode)
|
||||
(sp-local-pair "%" "%"
|
||||
:unless '(sp-in-string-p)
|
||||
|
@ -63,7 +61,11 @@
|
|||
(sp-local-pair "<%# " " %>" :insert "C-c #")
|
||||
(sp-local-tag "%" "<% " " %>")
|
||||
(sp-local-tag "=" "<%= " " %>")
|
||||
(sp-local-tag "#" "<%# " " %>")))
|
||||
(sp-local-tag "#" "<%# " " %>"))
|
||||
|
||||
(eval-after-load 'web-mode
|
||||
'(progn
|
||||
(defun prelude-web-mode-defaults ())
|
||||
(setq prelude-web-mode-hook 'prelude-web-mode-defaults)
|
||||
|
||||
(add-hook 'web-mode-hook (lambda ()
|
||||
|
|
Loading…
Reference in a new issue