From fe673c846db505916f756e612e6a455578a97802 Mon Sep 17 00:00:00 2001 From: Rob Harbaugh Date: Wed, 22 Apr 2026 10:52:36 -0400 Subject: [PATCH] Fix nvim-treesitter config: use explicit config fn instead of main lazy.nvim's `main` shorthand resolves the module before the plugin is fully loaded, causing 'nvim-treesitter.configs not found' on first run. Explicit config function defers the require until setup time. Co-Authored-By: Claude Sonnet 4.6 --- shared/.config/nvim/init.lua | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/shared/.config/nvim/init.lua b/shared/.config/nvim/init.lua index 9b90bec..3e23c3d 100644 --- a/shared/.config/nvim/init.lua +++ b/shared/.config/nvim/init.lua @@ -258,17 +258,18 @@ require('lazy').setup({ { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', - main = 'nvim-treesitter.configs', - opts = { - ensure_installed = (function() - local t = { 'bash', 'json', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'vim', 'vimdoc', 'yaml' } - vim.list_extend(t, _lang.parsers or {}) - return t - end)(), - auto_install = true, - highlight = { enable = true }, - indent = { enable = true }, - }, + config = function() + require('nvim-treesitter.configs').setup({ + ensure_installed = (function() + local t = { 'bash', 'json', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'vim', 'vimdoc', 'yaml' } + vim.list_extend(t, _lang.parsers or {}) + return t + end)(), + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, }, --------------------------------------------------------------------------