I have recently moved my blog setup to astro. And, as an emacs user, every time I get into a new technology, I need to get it set up in my environment. That’s the one thing VSCode does better, I guess. Despite my interest in Nix and my recent emacs brain rot, I hate doing.
Fortunately, I found a
configuration
online. I plopped it into my .spacemacs
file and syntax highlighting worked, yay
🎉! However, the LSP part didn’t. Because I wanted to get my website up and
running quickly, I powered through it and made do with just syntax highlighting.
Now that I got more time to fix this, I found a solution for my problem:
;; within your `dotspacemacs/user-config`
(setq auto-mode-alist
(cons '("\\.astro$" . typescript-tsx-mode) auto-mode-alist))
If you have lsp-mode
on on your Spacemacs, it will ask you to install
astro-ls
, which you should do. However, if you’re on Nix as I am, you don’t
want to have something installed outside it. I was happy to find that it is
available on Nix as astro-language-server
.