'Neovim Treesitter highlighting HTML,JS,PHP in PHP file
I recently switched to Neovim and I tried to configure native LSP with Treesitter.
I ran into some wrong highlighting with PHP combined with HTML. Everytime when I write php in html element, closing tag is not highlighted.
Treesitter cfg:
local configs = require'nvim-treesitter.configs'
configs.setup {
ensure_installed = 'maintained', --Only use parsers that are maintained
highlight = { -- enable highlighting
enable = true,
},
indent = {
enabled = true,
},
}
I found something about multiple lang support for one file type with language injections but I have no idea how to implement that.
Solution 1:[1]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Tomz |