25 lines
480 B
Lua
25 lines
480 B
Lua
|
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,
|
||
|
}
|