Compare commits

...

3 Commits

3 changed files with 20 additions and 3 deletions

View File

@ -34,10 +34,25 @@ Before Input After
## Setup
Requires `Nvim 0.9.0` and up.
Requires `Nvim 0.9.5` and up.
```lua
require('nvim-ts-autotag').setup()
require('nvim-ts-autotag').setup({
opts = {
-- Defaults
enable_close = true, -- Auto close tags
enable_rename = true, -- Auto rename pairs of tags
enable_close_on_slash = false -- Auto close on trailing </
},
-- Also override individual filetype configs, these take priority.
-- Empty by default, useful if one of the "opts" global settings
-- doesn't work well in a specific filetype
per_filetype = {
["html"] = {
enable_close = false
}
}
})
```
> [!CAUTION]

View File

@ -112,7 +112,8 @@ local Opts = {
}
---@class nvim-ts-autotag.PluginSetup
---@field opts nvim-ts-autotag.Opts?
---@field private did_setup boolean
---@field opts nvim-ts-autotag.Opts? General setup optionss
---@field aliases { [string]: string }? Aliases a filetype to an existing filetype tag config
---@field per_filetype { [string]: nvim-ts-autotag.Opts }? Per filetype config overrides
local Setup = {

View File

@ -442,6 +442,7 @@ end
M.attach = function(bufnr)
bufnr = bufnr or vim.api.nvim_get_current_buf()
---@diagnostic disable-next-line: invisible
if not Setup.did_setup then
local _, ts_configs = pcall(require, "nvim-treesitter.configs")
if not ts_configs then