update treesitter for nvim 0.12.2

This commit is contained in:
2026-04-30 10:12:59 +02:00
parent 9b3b13f06e
commit ce27e4a87d
4 changed files with 28 additions and 32 deletions

BIN
lua/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -1,34 +1,30 @@
return {
"nvim-treesitter/nvim-treesitter",
lazy = false,
lazy = false, -- Treesitter must not be lazy-loaded in the new version
build = ":TSUpdate",
config = function()
require("nvim-treesitter").setup({
local ts = require("nvim-treesitter")
local supported_languages = {
"lua", "vim", "vimdoc", "query", "dart", "python",
"dockerfile", "yaml", "bash", "json", "html",
"css", "javascript", "sql", "markdown", "markdown_inline",
}
-- 1. Global Settings
ts.setup({
install_dir = vim.fn.stdpath("data") .. "/site",
highlight = {
enable = true,
-- additional_vim_regex_highlighting = false,
},
indent = { enable = true },
autotag = { enable = true },
ensure_installed = {
"lua",
"vim",
"vimdoc",
"query",
"dart",
"python",
"dockerfile",
"yaml",
"bash",
"json",
"html",
"css",
"javascript",
"sql",
"markdown",
"markdown_inline",
},
auto_install = true,
})
-- 2. Bulk Install Parsers (Asynchronous)
ts.install(supported_languages)
-- 3. Enable Highlighting
vim.api.nvim_create_autocmd("FileType", {
pattern = supported_languages,
callback = function()
local lang = vim.treesitter.language.get_lang(vim.bo.filetype)
if lang then
vim.treesitter.start()
end
end,
})
end,
}