add treesitter context

This commit is contained in:
2025-07-14 09:16:25 +01:00
parent 2f5b79505f
commit 8dd515d654

View File

@ -3,9 +3,14 @@ return {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
dependencies = { dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects', -- maybe try mini.ai instead? 'nvim-treesitter/nvim-treesitter-textobjects', -- maybe try mini.ai instead?
'nvim-treesitter/nvim-treesitter-context',
}, },
build = ':TSUpdate', build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts main = 'nvim-treesitter.configs', -- Sets main module to use for opts
config = function(_, opts)
require('nvim-treesitter.configs').setup(opts)
require('treesitter-context').setup(opts.context)
end,
opts = { opts = {
auto_install = false, auto_install = false,
highlight = { enable = true }, highlight = { enable = true },
@ -72,6 +77,9 @@ return {
include_surrounding_whitespace = true, include_surrounding_whitespace = true,
}, },
}, },
context = {
enable = true,
},
}, },
}, },
} }