Go to file
2021-04-26 21:31:20 +07:00
.github updat treesitter and add rename jsx nested_identifier 2021-04-16 11:37:59 +07:00
lua add hbs 2021-04-26 21:31:20 +07:00
plugin refactor to ts module 2021-03-10 13:09:41 +07:00
sample fix #14 2021-04-19 18:50:38 +07:00
tests add log utils 2021-04-20 15:52:30 +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 fix typo readme.md 2021-04-25 12:08:46 +07:00

nvim-ts-autotag

Use treesitter to autoclose and autorename html tag

It work with html,tsx,vue,svelte.

Usage

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

Setup

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