Go to file
2021-03-08 21:20:19 +07:00
.github Init 2021-03-08 10:49:04 +07:00
lua add autorename 2021-03-08 21:14:32 +07:00
sample add autorename 2021-03-08 21:14:32 +07:00
tests add autorename 2021-03-08 21:14:32 +07:00
.gitignore add autorename 2021-03-08 21:14:32 +07:00
LICENSE Initial commit 2021-03-08 07:59:24 +07:00
Makefile add autorename 2021-03-08 21:14:32 +07:00
README.md Update README.md 2021-03-08 21:20:19 +07:00

nvim-ts-autotag

Use treesitter to autoclose and autorename xml tag

It work with tsx,vue,svelte. Use treesitter then it only close and rename the tag match with your current cursor.

Usage

Before        Input         After
------------------------------------
<div           >         <div></div>
------------------------------------

Setup

Neovim 0.5 with and nvim-treesitter to work

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-ts-closetag').setup({
  filetypes = { "html" , "xml" },
})

Ref

vim-closetag