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 <noreply@anthropic.com>
This commit is contained in:
@@ -258,17 +258,18 @@ require('lazy').setup({
|
|||||||
{
|
{
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
main = 'nvim-treesitter.configs',
|
config = function()
|
||||||
opts = {
|
require('nvim-treesitter.configs').setup({
|
||||||
ensure_installed = (function()
|
ensure_installed = (function()
|
||||||
local t = { 'bash', 'json', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'vim', 'vimdoc', 'yaml' }
|
local t = { 'bash', 'json', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'vim', 'vimdoc', 'yaml' }
|
||||||
vim.list_extend(t, _lang.parsers or {})
|
vim.list_extend(t, _lang.parsers or {})
|
||||||
return t
|
return t
|
||||||
end)(),
|
end)(),
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
},
|
})
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user