Skip to content

Commit

Permalink
emacs: add web mode for astro
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborpilz committed Dec 12, 2023
1 parent 2469e94 commit 79c5d60
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions home/config/doom/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@
(css "https://github.com/tree-sitter/tree-sitter-css")
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")))

(define-derived-mode astro-mode web-mode "astro")
(setq auto-mode-alist
(append '(("\\.astro\\'" . astro-mode))
auto-mode-alist))

(use-package! lsp-tailwindcss
:defer t
:init
Expand Down
10 changes: 10 additions & 0 deletions home/config/doom/config.org
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,16 @@ Because ~astro-ts-mode~ uses treesitter, treesitter needs to be set up to handle
(css "https://github.com/tree-sitter/tree-sitter-css")
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")))
#+end_src

Define Astro as a derived mode for ~.astro~ files.

#+begin_src elisp
(define-derived-mode astro-mode web-mode "astro")
(setq auto-mode-alist
(append '(("\\.astro\\'" . astro-mode))
auto-mode-alist))
#+end_src

**** Tailwind
Add the tailwind lsp package
#+begin_src elisp :tangle packages.el
Expand Down
2 changes: 2 additions & 0 deletions home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ with mylib;
# bat is a better cat (as a program, at least)
bat

mob

htop

pandoc
Expand Down

0 comments on commit 79c5d60

Please sign in to comment.