-
How to enable syntax highlighting?Hi! I'm trying to get syntax highlighting to work in Svelte, Astro, TSX, etc files using NVF (configured declaratively via Home Manager in flakes). I’ve followed the docs and tried multiple approaches, but syntax highlighting does not activate. My configuration looks like this:syntaxHighlighting = true;
treesitter = {
enable = true;
fold = true;
highlight.enable = true;
};
languages = {
enableTreesitter = true;
rust.enable = true;
nix.enable = true;
astro.enable = true;
lua.enable = true;
css.enable = true;
tailwind.enable = true;
svelte = {
enable = true;
format.enable = true;
lsp.enable = true;
treesitter.enable = true;
};
ts = {
enable = true;
extensions.ts-error-translator.enable = true;
};
markdown = {
enable = true;
extensions.markview-nvim.enable = true;
};
};I also tried these alternatives for installing parsers explicitly: treesitter.grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
svelte
];And even: treesitter.grammars = pkgs.vimPlugins.nvim-treesitter.allGrammars;The problemWhen I open a
Tree-sitter highlighting does work correctly in other filetypes like What I’d like to know
Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
rxtsel
Jan 29, 2026
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Thanks a lot! That was the issue.
I previously had in my
flake.nix:Now I changed it to:
Then I ran:
And that fixed the problem — syntax highlighting works correctly in Svelte files now.
Really appreciate the help! ✨