Move lang files
Some checks are pending
/ Test config on ${{matrix.node}} (20) (push) Waiting to run
Some checks are pending
/ Test config on ${{matrix.node}} (20) (push) Waiting to run
This commit is contained in:
parent
bf90b046b8
commit
1f20dd7bc1
27 changed files with 81 additions and 82 deletions
50
lisp/langs/icejam-lang-web.el
Normal file
50
lisp/langs/icejam-lang-web.el
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue