mirror of
https://github.com/windwp/nvim-ts-autotag.git
synced 2025-01-02 14:29:22 -06:00
31 lines
804 B
Lua
31 lines
804 B
Lua
local internal = require("nvim-ts-autotag.internal")
|
|
|
|
local M = {}
|
|
|
|
function M.init()
|
|
local ts = require('nvim-treesitter')
|
|
if ts and ts.define_modules then
|
|
require('nvim-treesitter').define_modules({
|
|
autotag = {
|
|
module_path = 'nvim-ts-autotag.internal',
|
|
is_supported = function(lang)
|
|
return internal.is_supported(lang)
|
|
end,
|
|
},
|
|
})
|
|
end
|
|
end
|
|
|
|
function M.ensure_ts_parsers_installed() end
|
|
|
|
function M.setup(opts)
|
|
internal.setup(opts)
|
|
vim.cmd([[augroup nvim_ts_xmltag]])
|
|
vim.cmd([[autocmd!]])
|
|
vim.cmd([[autocmd FileType * call v:lua.require('nvim-ts-autotag.internal').attach()]])
|
|
vim.cmd([[autocmd BufDelete * lua require('nvim-ts-autotag.internal').detach(vim.fn.expand('<abuf>'))]])
|
|
vim.cmd([[augroup end]])
|
|
end
|
|
|
|
return M
|