Files
LazyVim/lua/lazyvim/plugins/extras/ui/treesitter-context.lua
Stefan Boca ab0135093b feat(treesitter-context): which-key toggle (#4059)
## Description

Add a which-key toggle for treesitter-context

## Screenshots


![image](https://github.com/user-attachments/assets/28c02607-a7e8-409c-a190-4fd2db85e8bb)

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-07-15 22:58:34 +02:00

23 lines
478 B
Lua

-- Show context of the current function
return {
"nvim-treesitter/nvim-treesitter-context",
event = "VeryLazy",
opts = function()
local tsc = require("treesitter-context")
LazyVim.toggle.map("<leader>ut", {
name = "Treesitter Context",
get = tsc.enabled,
set = function(state)
if state then
tsc.enable()
else
tsc.disable()
end
end,
})
return { mode = "cursor", max_lines = 3 }
end,
}