LazyVim.LazyVim/lua/lazyvim/plugins/extras/ui/treesitter-context.lua

21 lines
475 B
Lua
Raw Normal View History

-- Show context of the current function
return {
"nvim-treesitter/nvim-treesitter-context",
event = "LazyFile",
opts = 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")
return { mode = "cursor", max_lines = 3 }
end,
}