Go to file
2021-03-10 13:09:41 +07:00
.github Init 2021-03-08 10:49:04 +07:00
lua refactor to ts module 2021-03-10 13:09:41 +07:00
plugin refactor to ts module 2021-03-10 13:09:41 +07:00
sample refactor to ts module 2021-03-10 13:09:41 +07:00
tests fix: jsx #3 2021-03-10 12:05:05 +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 refactor to ts module 2021-03-10 13:09:41 +07:00

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" },
})