dotfiles/.emacs.d/lisp/init-web.el

59 lines
1.7 KiB
EmacsLisp
Raw Normal View History

2022-08-12 06:40:14 +00:00
;;; init-web.el --- Web Configuration File -*- lexical-binding: t -*-
2021-08-17 11:49:19 +00:00
;;; Commentary:
;; Some parts copied from prelude-web.el, prelude-js.el and prelude-css.el
;;; Code:
(use-package web-mode
:custom
(web-mode-enable-auto-pairing nil)
:config
(sp-with-modes '(web-mode)
(sp-local-pair "%" "%"
:unless '(sp-in-string-p)
:post-handlers '(((lambda (&rest _ignored)
(just-one-space)
(save-excursion (insert " ")))
"SPC" "=" "#")))
(sp-local-tag "%" "<% " " %>")
(sp-local-tag "=" "<%= " " %>")
(sp-local-tag "#" "<%# " " %>"))
2022-09-16 05:50:26 +00:00
:init
2021-08-17 11:49:19 +00:00
(add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode))
2022-09-16 05:50:26 +00:00
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)))
2021-08-17 11:49:19 +00:00
2023-05-19 11:09:57 +00:00
(use-feature css-mode
2022-08-12 06:40:14 +00:00
:custom
2023-05-19 11:09:57 +00:00
(css-indent-offset 2))
2022-08-12 06:40:14 +00:00
(use-package scss-mode
:config
(add-to-list 'auto-mode-alist '("\\.scss\\'" . scss-mode))
:custom
(scss-compile-at-save nil))
2022-08-30 15:13:33 +00:00
(use-package sass-mode)
2022-08-12 06:40:14 +00:00
2021-08-17 11:49:19 +00:00
(use-package tagedit
2021-10-29 07:00:02 +00:00
:diminish
2022-09-02 10:36:08 +00:00
:commands tagedit-mode
2021-08-17 11:49:19 +00:00
:config (tagedit-add-paredit-like-keybindings)
:hook (html-mode . (lambda () (tagedit-mode 1))))
(use-package js2-mode
2022-09-16 05:50:26 +00:00
:init
2022-07-27 13:09:21 +00:00
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
2022-08-12 06:40:14 +00:00
:custom
(js-indent-level 2)
2021-08-17 11:49:19 +00:00
:hook (js2-mode . (lambda ()
(setq-local electric-layout-rules '((?\; . after)))
(setq mode-name "JS2")
(js2-imenu-extras-mode +1)
(subword-mode +1))))
2022-07-27 13:09:39 +00:00
(use-package mustache-mode
2022-09-16 05:50:26 +00:00
:init
2022-07-27 13:09:39 +00:00
(add-to-list 'auto-mode-alist '("\\.mustache\\'" . mustache-mode)))
2021-08-17 11:49:19 +00:00
(provide 'init-web)
;;; init-web.el ends here