This commit is contained in:
moritzrfs
2026-06-14 13:39:27 +02:00
parent 03cbd49af2
commit c2e40d6edb

View File

@@ -55,16 +55,26 @@ require("lazy").setup({
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
opts = {
ensure_installed = {
config = function()
local langs = {
"lua", "bash", "yaml", "json", "toml", "dockerfile",
"nix", "python", "markdown", "diff", "git_config",
},
highlight = { enable = true },
indent = { enable = true },
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
}
-- old API (nvim-treesitter < 1.0, nvim 0.9.x)
local ok, configs = pcall(require, "nvim-treesitter.configs")
if ok then
configs.setup({
ensure_installed = langs,
highlight = { enable = true },
indent = { enable = true },
})
return
end
-- new API (nvim-treesitter >= 1.0, nvim 0.10+): highlight is built-in
local ts_ok, ts = pcall(require, "nvim-treesitter")
if ts_ok and ts.install then
ts.install(langs)
end
end,
},