mirror of
https://github.com/windwp/nvim-ts-autotag.git
synced 2025-01-06 04:49:20 -06:00
45 lines
865 B
Markdown
45 lines
865 B
Markdown
|
# nvim-ts-closetag
|
||
|
Use treesitter to autoclose xml tag
|
||
|
|
||
|
it work well with tsx
|
||
|
|
||
|
## 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)
|