Go to file
2021-03-13 09:37:36 +07:00
.github add ci (#6) 2021-03-13 07:52:51 +07:00
lua skip replace on special char < > 2021-03-13 09:37:36 +07:00
plugin refactor to ts module 2021-03-10 13:09:41 +07:00
sample fix some case on closetag 2021-03-11 09:24:35 +07:00
tests skip replace on special char < > 2021-03-13 09:37:36 +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 2021-03-10 13:12:03 +07:00

nvim-ts-autotag

Use treesitter to autoclose and autorename xml tag

It work with html,xml,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" },
})