windwp / nvim-ts-autotag
git clone https://github.com/windwp/nvim-ts-autotag.git
🔥 on GitHub Trending today
Use treesitter to auto close and auto rename html tag
—
stars, 24h
—
stars, 7 days
+10
stars, 30 days · #10,006
2.1k
★ total
110
forks · 7 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageLua
LicenseMIT
Created2021-03-08 (5y ago)
Last push17d ago
Watchers7
OwnerUser
Seen on GitHub Trending
- 2026-10-20 — #9 monthly in lua · +10 ★
GitHub topics
Links
README excerpt
# nvim-ts-autotag
Use treesitter to **autoclose** and **autorename** html tag
It works with:
- astro
- dot
- glimmer
- handlebars
- html
- javascript
- jsx
- liquid
- vento
- markdown
- php
- rescript
- svelte
- tsx
- twig
- typescript
- vue
- xml
and more
## Usage
[code]
## Setup
Requires `Nvim 0.9.5` and up.
Note that `nvim-ts-autotag` will not work unless you have treesitter parsers (like `html`) installed for a given
filetype. See nvim-treesitter for installing parsers.
[code] lua
require('nvim-ts-autotag').setup({
aliases = {
["your language here"] = "html",
}
})
-- or
local TagConfigs = require("nvim-ts-autotag.config.init")
TagConfigs:add_alias("your language here", "html")
[code] lua
local TagConfigs = require("nvim-ts-autotag.config.init")
TagConfigs:update(TagConfigs:get("xml"):override("xml", {
start_tag_pattern = { "STag" },
end_tag_pattern = { "ETag" },
}))
[code] lua
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics,
{
underline = true,
virtual_text = {
spacing = 5,
severity_limit = 'Warning',
},
update_in_insert = true,
}
)
```
## Contributors
Thank @PriceHiller for his work on this plugin.
## Sponsor
If you find this plugin useful, please consider sponsoring the project.
Sponsor