Skip to content

Does anyone know how to have syntax highlighting on svelte files? #2894

Answered by Sophistiqq
Sophistiqq asked this question in Q&A
Discussion options

You must be logged in to vote

filetype of svelte files to html.
thats bad,why do that?

Treesitter on my machine is kinda neglecting the existence of svelte files, However setting filetype of svelte files to html works, I can have the syntax highlighting when I do :setfiletype html on svelte files and it's okay for me.

I just need now how can I automatically do it without typing the commands everytime.

EDIT

Found a simple solution now, I just created another table entry anywhere,
{
vim.filetype.add({
extension = {
svelte = "html",
},
})
},

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@Sophistiqq
Comment options

Answer selected by Sophistiqq
@siduck
Comment options

@Sophistiqq
Comment options

@siduck
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants