Add web-mode

This commit is contained in:
Jeremy Dormitzer 2021-04-05 10:44:24 -04:00
parent 2584727852
commit 4f7594b71f
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,29 @@
;; -*- lexical-binding: t; -*-
(use-package web-mode
:mode (("\\.phtml\\'" . web-mode)
("\\.tpl\\.php\\'" . web-mode)
("\\.[agj]sp\\'" . web-mode)
("\\.as[cp]x\\'" . web-mode)
("\\.erb\\'" . web-mode)
("\\.mustache\\'" . web-mode)
("\\.djhtml\\'" . web-mode)
("\\.hbs\\'" . web-mode)
("\\.html?\\'" . web-mode)
("\\.jsx?\\'" . web-mode)
("\\.mako\\'" . web-mode)
("\\.jinja2\\'" . web-mode))
:config
(setq web-mode-engines-alist
'(("django" . "\\.jinja2\\'")))
(add-hook 'web-mode-hook
(lambda ()
(when (equal web-mode-content-type "javascript")
(web-mode-set-content-type "jsx"))
(when (or (equal web-mode-content-type "javascript")
(equal web-mode-content-type "jsx"))
(lsp-deferred))))
:custom
(web-mode-enable-auto-pairing nil))
(provide 'init-web)

View File

@ -89,6 +89,7 @@
(require 'init-clojure) (require 'init-clojure)
(require 'init-lisp) (require 'init-lisp)
(require 'init-js) (require 'init-js)
(require 'init-web)
(require 'init-yaml) (require 'init-yaml)
(require 'init-groovy) (require 'init-groovy)
(require 'init-terraform) (require 'init-terraform)