update shit

This commit is contained in:
Robin Jenni
2026-06-04 10:58:41 +02:00
parent f305363f25
commit 3d10435374
3 changed files with 38 additions and 8 deletions
+29
View File
@@ -0,0 +1,29 @@
return {
"nvim-treesitter/nvim-treesitter",
branch = "main",
build = function()
require("nvim-treesitter").update()
end,
event = { "BufReadPre", "BufNewFile" },
config = function()
local ts = require("nvim-treesitter")
local ensure = { "swift" }
local installed = ts.get_installed and ts.get_installed() or {}
local to_install = {}
for _, lang in ipairs(ensure) do
if not vim.tbl_contains(installed, lang) then
table.insert(to_install, lang)
end
end
if #to_install > 0 then
ts.install(to_install)
end
vim.api.nvim_create_autocmd("FileType", {
pattern = { "swift" },
callback = function()
pcall(vim.treesitter.start)
end,
})
end,
}