2024-05-16 18:20:09 +02:00
|
|
|
-- Show context of the current function
|
|
|
|
return {
|
|
|
|
"nvim-treesitter/nvim-treesitter-context",
|
2024-12-05 00:11:40 -08:00
|
|
|
event = "LazyFile",
|
2024-07-15 13:58:34 -07:00
|
|
|
opts = function()
|
|
|
|
local tsc = require("treesitter-context")
|
2024-11-07 15:54:47 +01:00
|
|
|
Snacks.toggle({
|
2024-07-15 13:58:34 -07:00
|
|
|
name = "Treesitter Context",
|
|
|
|
get = tsc.enabled,
|
|
|
|
set = function(state)
|
|
|
|
if state then
|
|
|
|
tsc.enable()
|
2024-05-16 18:20:09 +02:00
|
|
|
else
|
2024-07-15 13:58:34 -07:00
|
|
|
tsc.disable()
|
2024-05-16 18:20:09 +02:00
|
|
|
end
|
|
|
|
end,
|
2024-11-07 15:54:47 +01:00
|
|
|
}):map("<leader>ut")
|
2024-07-15 13:58:34 -07:00
|
|
|
return { mode = "cursor", max_lines = 3 }
|
|
|
|
end,
|
2024-05-16 18:20:09 +02:00
|
|
|
}
|