2021-04-05 14:44:24 +00:00
|
|
|
;; -*- 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)
|
|
|
|
("\\.mako\\'" . web-mode)
|
|
|
|
("\\.jinja2\\'" . web-mode))
|
|
|
|
:config
|
|
|
|
(setq web-mode-engines-alist
|
|
|
|
'(("django" . "\\.jinja2\\'")))
|
|
|
|
:custom
|
2023-03-31 00:25:07 +00:00
|
|
|
(web-mode-enable-auto-pairing nil)
|
|
|
|
(web-mode-markup-indent-offset 2)
|
|
|
|
(web-mode-code-indent-offset 2)
|
|
|
|
(web-mode-script-padding 2))
|
2021-04-05 14:44:24 +00:00
|
|
|
|
2023-04-05 12:04:43 +00:00
|
|
|
(define-derived-mode js-web-mode web-mode "JS Web Mode"
|
|
|
|
"Web mode in JS files.")
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.jsx?\\'" . js-web-mode))
|
|
|
|
|
|
|
|
(define-derived-mode html-web-mode web-mode "HTML Web Mode"
|
|
|
|
"Web mode in HTML files.")
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.html?\\'" . html-web-mode))
|
|
|
|
|
2021-04-05 14:44:24 +00:00
|
|
|
(provide 'init-web)
|