marleyvim/nvim/lua/plugins/ui/nvim-treesitter-context.lua

25 lines
480 B
Lua
Raw Normal View History

2025-01-04 13:00:07 -08:00
return {
'nvim-treesitter-context',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
after = function()
local tsc = require('treesitter-context')
Snacks.toggle({
name = 'treesitter context',
get = tsc.enabled,
set = function(state)
if state then
tsc.enable()
else
tsc.disable()
end
end,
}):map('<LEADER>ut')
tsc.setup({
mode = 'cursor',
max_lines = 3,
})
end,
}