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", "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", build = ":TSUpdate",
opts = { config = function()
ensure_installed = { local langs = {
"lua", "bash", "yaml", "json", "toml", "dockerfile", "lua", "bash", "yaml", "json", "toml", "dockerfile",
"nix", "python", "markdown", "diff", "git_config", "nix", "python", "markdown", "diff", "git_config",
}, }
-- 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 }, highlight = { enable = true },
indent = { enable = true }, indent = { enable = true },
}, })
config = function(_, opts) return
require("nvim-treesitter.configs").setup(opts) 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, end,
}, },