Move lang files
Some checks are pending
/ Test config on ${{matrix.node}} (20) (push) Waiting to run

This commit is contained in:
Maciej 2024-07-27 10:52:59 +03:00
parent bf90b046b8
commit 1f20dd7bc1
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
27 changed files with 81 additions and 82 deletions

View file

@ -0,0 +1,50 @@
;;; web -- summary -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(require 'icejam-lsp)
(require 'icejam-flycheck)
(use-package web-mode
:requires (lsp-mode flycheck)
:straight t)
;; Eex Web mode
(add-to-list 'auto-mode-alist '("\\.eex\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.leex\\'" . web-mode))
;; ERB mode
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
;; Vue JS
(add-to-list 'auto-mode-alist '("\\.vue\\'" . web-mode))
(setq web-mode-extra-auto-pairs
'(("eex" . (("<%" "%>")))
("leex" . (("<%" "%>")))
("erb" . (("<%" "%>")
("beg" "end")))))
(defun activate-web-mode ()
"Web mode overrides."
;; Indent web mode scripts by 2
(setq-local web-mode-script-padding 2)
(setq-local web-mode-code-indent-offset 2)
(setq-local web-mode-markup-indent-offset 2)
(setq-local lsp-eldoc-enable-hover nil)
(setq-local flycheck-check-syntax-automatically '(save mode-enabled))
(add-to-list (make-local-variable 'company-backends)
'(company-capf company-yasnippet))
(when (string-match-p ".jsx" (buffer-file-name))
(lsp))
(when (string-match-p ".tsx" (buffer-file-name))
(lsp))
(when (string-match-p ".vue" (buffer-file-name))
(lsp)))
(add-hook 'web-mode-hook 'activate-web-mode)
(provide 'icejam-lang-web)
;;; icejam-lang-web.el ends here