Skip to content

Commit

Permalink
Fix smartparens configuration in html layer
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBB committed Sep 25, 2015
1 parent 6a520b6 commit 35012a6
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions layers/+lang/html/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,29 @@
:defer t))

(defun html/post-init-smartparens ()
(spacemacs/add-to-hooks (if dotspacemacs-smartparens-strict-mode
'smartparens-strict-mode
'smartparens-mode)
'(css-mode-hook scss-mode-hook sass-mode-hook less-css-mode-hook)))
(spacemacs/add-to-hooks
(if dotspacemacs-smartparens-strict-mode
'smartparens-strict-mode
'smartparens-mode)
'(css-mode-hook scss-mode-hook sass-mode-hook less-css-mode-hook))

;; Only use smartparens in web-mode
(spacemacs|use-package-add-hook web-mode
:post-config
(progn
(message ">>> Yo!!")
(setq web-mode-enable-auto-pairing nil)
(sp-local-pair 'web-mode "<% " " %>")
(sp-local-pair 'web-mode "{ " " }")
(sp-local-pair 'web-mode "<%= " " %>")
(sp-local-pair 'web-mode "<%# " " %>")
(sp-local-pair 'web-mode "<%$ " " %>")
(sp-local-pair 'web-mode "<%@ " " %>")
(sp-local-pair 'web-mode "<%: " " %>")
(sp-local-pair 'web-mode "{{ " " }}")
(sp-local-pair 'web-mode "{% " " %}")
(sp-local-pair 'web-mode "{%- " " %}")
(sp-local-pair 'web-mode "{# " " #}"))))

(defun html/init-tagedit ()
(use-package tagedit
Expand All @@ -166,21 +185,6 @@
(push 'company-web-html company-backends-web-mode)
:config
(progn
;; Only use smartparens in web-mode
(setq web-mode-enable-auto-pairing nil)

(sp-local-pair 'web-mode "<% " " %>")
(sp-local-pair 'web-mode "{ " " }")
(sp-local-pair 'web-mode "<%= " " %>")
(sp-local-pair 'web-mode "<%# " " %>")
(sp-local-pair 'web-mode "<%$ " " %>")
(sp-local-pair 'web-mode "<%@ " " %>")
(sp-local-pair 'web-mode "<%: " " %>")
(sp-local-pair 'web-mode "{{ " " }}")
(sp-local-pair 'web-mode "{% " " %}")
(sp-local-pair 'web-mode "{%- " " %}")
(sp-local-pair 'web-mode "{# " " #}")

(evil-leader/set-key-for-mode 'web-mode
"meh" 'web-mode-dom-errors-show
"mgb" 'web-mode-element-beginning
Expand Down

0 comments on commit 35012a6

Please sign in to comment.