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,8 +258,8 @@ require('lazy').setup({
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
main = 'nvim-treesitter.configs',
|
||||
opts = {
|
||||
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 {})
|
||||
@@ -268,7 +268,8 @@ require('lazy').setup({
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user