EJS Treesitter Syntax Highlighting in Neovim


Ejs is an embedded javascript templating language.

After installing nvim-treesitter` and running:

:TSInstall html javascript embedded_template

Adding this to your config seems to work well enough for ejs files:

vim.filetype.add({ extension = { ejs = "ejs" } })
vim.treesitter.language.register("html", "ejs")
vim.treesitter.language.register("javascript", "ejs")
vim.treesitter.language.register("embedded_template", "ejs")