aboutsummaryrefslogtreecommitdiffstats
path: root/nvim/lua/plugins
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2026-04-04 16:19:29 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2026-04-04 16:26:40 -0400
commit4c6b12fce57615c38043d55054da8a05d716503f (patch)
tree01010a7c4ffa44e193194f2a257ce3c27c5f28c9 /nvim/lua/plugins
parent35fc70735c2563de7dbbc6c4bdff3e91f2f8957c (diff)
Update nvim-treesitter config
Diffstat (limited to 'nvim/lua/plugins')
-rw-r--r--nvim/lua/plugins/treesitter.lua38
1 files changed, 30 insertions, 8 deletions
diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua
index a218e13..2f0f654 100644
--- a/nvim/lua/plugins/treesitter.lua
+++ b/nvim/lua/plugins/treesitter.lua
@@ -1,12 +1,34 @@
return {
'nvim-treesitter/nvim-treesitter',
- build = ':TSUpdate',
- opts = {
- ensure_installed = { "help", "lua", "python", "javascript", "typescript", "c", "latex", "vim", "go" },
- auto_install = true,
- highlight = {
- enable = true,
- additional_vim_regex_highlighting = false
+ lazy = false,
+ build = function()
+ local nvim_treesitter = require("nvim-treesitter")
+ local util = require("nvim.lua.shared")
+
+ local installed = util.to_set(nvim_treesitter.get_installed())
+ local ensure_installed = util.to_set {
+ "markdown", "markdown_inline",
+ "vimdoc",
+ "c",
+ "make",
+ "rust",
+ "go", "gowork", "gotmpl",
+ "json", "yaml", "toml",
+ "python",
+ "html",
+ "javascript",
+ "julia", "r",
+ "bash",
+ "latex",
+ "sql",
}
- }
+
+ local diff = util.set_difference(ensure_installed, installed)
+ if #diff > 0 then
+ -- NOTE: potential race condition because install is async
+ nvim_treesitter.install(util.keys(diff))
+ end
+
+ nvim_treesitter.update({ summary = true })
+ end,
}