emmet-mode: bind to TAB & enable in reason-mode
TAB now either indents, expands the snippet at point, or expands the emmet expression at point. Also it now falls back to emmet-expand-line if yasnippet won't load.
This commit is contained in:
parent
8bbff852f7
commit
a876d87f5e
2 changed files with 21 additions and 5 deletions
|
@ -16,14 +16,15 @@
|
|||
(def-package! emmet-mode
|
||||
:commands emmet-mode
|
||||
:preface (defvar emmet-mode-keymap (make-sparse-keymap))
|
||||
:hook (css-mode web-mode html-mode haml-mode nxml-mode rjsx-mode)
|
||||
:hook (css-mode web-mode html-mode haml-mode nxml-mode rjsx-mode reason-mode)
|
||||
:config
|
||||
(when (require 'yasnippet nil t)
|
||||
(add-hook 'emmet-mode-hook #'yas-minor-mode-on))
|
||||
(setq emmet-move-cursor-between-quotes t)
|
||||
(add-hook! 'rjsx-mode-hook
|
||||
(setq-local emmet-expand-jsx-className? t))
|
||||
(setq-hook! 'rjsx-mode-hook emmet-expand-jsx-className? t)
|
||||
(map! :map emmet-mode-keymap
|
||||
:v "M-e" #'emmet-wrap-with-markup
|
||||
:i "M-e" #'emmet-expand-yas
|
||||
:v [tab] #'emmet-wrap-with-markup
|
||||
:i [tab] #'+web/indent-or-yas-or-emmet-expand
|
||||
:i "M-E" #'emmet-expand-line))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue