mirror of
https://github.com/windwp/nvim-ts-autotag.git
synced 2025-01-24 13:03:54 -06:00
Compare commits
3 Commits
349f15a9f0
...
38ac929e15
Author | SHA1 | Date | |
---|---|---|---|
38ac929e15 | |||
d06dc900f3 | |||
98fca9bf0e |
19
README.md
19
README.md
@ -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]
|
||||
|
@ -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 = {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user