Add treesitter context

This commit is contained in:
Marcelo Jacobus 2025-06-29 21:04:02 -03:00
parent 07c65128fb
commit c20880fc7d
2 changed files with 21 additions and 20 deletions

View file

@ -0,0 +1,21 @@
return {
"nvim-treesitter/nvim-treesitter-context",
-- event = "LazyFile",
opts = { mode = "cursor", max_lines = 3 },
keys = {
{
"<leader>ut",
function()
local tsc = require("treesitter-context")
tsc.toggle()
-- TODO: Convert this message to plain nvim
-- if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then
-- LazyVim.info("Enabled Treesitter Context", { title = "Option" })
-- else
-- LazyVim.warn("Disabled Treesitter Context", { title = "Option" })
-- end
end,
desc = "Toggle Treesitter Context",
},
},
}

View file

@ -1,20 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter-context",
event = "LazyFile",
opts = { mode = "cursor", max_lines = 3 },
keys = {
{
"<leader>ut",
function()
local tsc = require("treesitter-context")
tsc.toggle()
if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then
LazyVim.info("Enabled Treesitter Context", { title = "Option" })
else
LazyVim.warn("Disabled Treesitter Context", { title = "Option" })
end
end,
desc = "Toggle Treesitter Context",
},
},
}