Use treesitter to autoclose and autorename html tag
It work with html,tsx,vue,svelte,php,rescript.
Before Input After
------------------------------------
<div > <div></div>
<div></div> ciwspan<esc> <span></span>
------------------------------------
Neovim 0.5 and nvim-treesitter to work
User treesitter setup
require'nvim-treesitter.configs'.setup {
autotag = {
enable = true,
}
}
or you can use a set up function
require('nvim-ts-autotag').setup()
If you have that issue #19
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics,
{
underline = true,
virtual_text = {
spacing = 5,
severity_limit = 'Warning',
},
update_in_insert = true,
}
)
local filetypes = {
'html', 'javascript', 'javascriptreact', 'typescriptreact', 'svelte', 'vue', 'rescript'
}
local skip_tags = {
'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'slot',
'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr','menuitem'
}
require'nvim-treesitter.configs'.setup {
autotag = {
enable = true,
filetypes = { "html" , "xml" },
}
}
-- OR
require('nvim-ts-autotag').setup({
filetypes = { "html" , "xml" },
})