mirror of
https://github.com/windwp/nvim-ts-autotag.git
synced 2025-01-01 12:49:15 -06:00
.github | ||
lua | ||
plugin | ||
sample | ||
tests | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
README.md |
nvim-ts-autotag
Use treesitter to autoclose and autorename xml tag
It work with tsx,vue,svelte.
Usage
Before Input After
------------------------------------
<div > <div></div>
------------------------------------
Setup
Neovim 0.5 with 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()
Default values
local filetypes = {
'html', 'xml', 'javascript', 'javascriptreact', 'typescriptreact', 'svelte', 'vue'
}
local skip_tags = {
'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'slot',
'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr','menuitem'
}
Override default values
require'nvim-treesitter.configs'.setup {
autotag = {
enable = true,
filetypes = { "html" , "xml" },
}
}
-- OR
require('nvim-ts-autotag').setup({
filetypes = { "html" , "xml" },
})