Closed s1nistr4 closed 10 months ago
Do you have treesitter parser for html installed?
Same here downloaded it using Packer, show up on PackerSync as properly installed. Added the lines in my treesitter.lua file yet it does not work on any html files I open.
Unfortunately, the plugin does not work for me either. I use NvChad, so the lazy.nvim, and the following configuration for treesitter and nvim-ts-autoclose:
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
-- defaults
"vim",
"lua",
"markdown",
"html",
"css",
"javascript",
"typescript",
"json",
"c_sharp",
"sql",
"yaml",
"xml",
"tsx",
},
autotag = {
enable = true
},
},
},
{
"windwp/nvim-ts-autotag",
dependencies = "nvim-treesitter/nvim-treesitter",
event = "VeryLazy",
config = function()
require("nvim-ts-autotag").setup()
end,
},
When I run :TSModuleInfo
autotag is enabled.
Especially important to me would be the automatic closing of xml tags.
@wambldor I was also having issues, but I fixed them. I think you need to add it to the dependencies array like:
{
"nvim-treesitter/nvim-treesitter",
dependencies = {
"windwp/nvim-ts-autotag"
},
opts = {
ensure_installed = {
-- defaults
"vim",
"lua",
"markdown",
"html",
"css",
"javascript",
"typescript",
"json",
"c_sharp",
"sql",
"yaml",
"xml",
"tsx",
},
autotag = {
enable = true
},
},
}
Works for me in html and tsx/jsx files.
Renmaing tag back from <xyz>
to <div>
works with quirks....
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I follow the instructions in the readme, as well as have treesitter installed, then I try renaming tags and nothing happens.