fix: small improvements

This commit is contained in:
2026-09-11 21:32:43 +02:00
parent 8292ff741d
commit 1cf3eef5e9
6 changed files with 81 additions and 36 deletions
+15 -4
View File
@@ -9,6 +9,8 @@ end)
-- Treesitter
Config.now_if_args(function()
vim.treesitter.language.register('bash', 'sh')
vim.treesitter.language.register('tsx', 'typescriptreact')
local filetypes = {
'html', 'css', 'lua', 'go', 'php', 'blade', 'sql', 'javascript',
@@ -23,10 +25,19 @@ Config.now_if_args(function()
end, 'Start tree-sitter')
Config.later(function()
vim.pack.add({ 'https://github.com/nvim-treesitter/nvim-treesitter' })
require('nvim-treesitter').install(vim.tbl_map(function(ft)
return vim.treesitter.language.get_lang(ft) or ft
end, filetypes))
local missing = {}
for _, ft in ipairs(filetypes) do
local lang = vim.treesitter.language.get_lang(ft) or ft
if #vim.api.nvim_get_runtime_file('parser/' .. lang .. '.so', false) == 0 then
table.insert(missing, lang)
end
end
if #missing > 0 then
vim.pack.add({ 'https://github.com/nvim-treesitter/nvim-treesitter' })
require('nvim-treesitter').install(missing)
end
end)
end)