nvim-ts-autotag/README.md

49 lines
977 B
Markdown
Raw Normal View History

2021-03-08 06:19:01 -06:00
# nvim-ts-autotag
Use treesitter to autoclose and autorename xml tag
It work with tsx,vue,svelte. it use treesitter then it only close and rename the tag match with your current cursor.
2021-03-07 21:47:09 -06:00
## Usage
``` text
Before Input After
------------------------------------
<div > <div></div>
------------------------------------
```
2021-03-08 06:19:01 -06:00
2021-03-07 21:47:09 -06:00
## Setup
Neovim 0.5 with and nvim-treesitter to work
``` lua
2021-03-08 08:18:10 -06:00
require('nvim-ts-autotag').setup()
2021-03-07 21:47:09 -06:00
```
## 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)