2021-03-07 21:47:09 -06:00
|
|
|
# nvim-ts-closetag
|
|
|
|
Use treesitter to autoclose xml tag
|
|
|
|
|
2021-03-07 22:41:00 -06:00
|
|
|
it work with tsx,vue,svelte
|
2021-03-07 21:47:09 -06:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
``` text
|
|
|
|
Before Input After
|
|
|
|
------------------------------------
|
|
|
|
<div > <div></div>
|
|
|
|
------------------------------------
|
|
|
|
```
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
Neovim 0.5 with and nvim-treesitter to work
|
|
|
|
|
|
|
|
``` lua
|
|
|
|
require('nvim-ts-closetag').setup()
|
|
|
|
```
|
|
|
|
|
|
|
|
## Default values
|
|
|
|
|
|
|
|
``` lua
|
|
|
|
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
|
|
|
|
|
|
|
|
``` lua
|
|
|
|
require('nvim-ts-closetag').setup({
|
|
|
|
filetypes = { "html" , "xml" },
|
|
|
|
})
|
|
|
|
```
|
|
|
|
|
|
|
|
# Ref
|
|
|
|
[vim-closetag](https://github.com/alvan/vim-closetag/edit/master/README.md)
|