diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index c833a707..60eb14f8 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -110,6 +110,23 @@ return { event = "LazyFile", enabled = true, opts = { mode = "cursor" }, + keys = { + { + "ut", + function() + local Util = require("lazy.core.util") + require("treesitter-context").toggle() + if require("treesitter-context.config").enable then + require("treesitter-context.config").enable = false + Util.warn("Disabled Treesitter Context", { title = "Option" }) + else + require("treesitter-context.config").enable = true + Util.info("Enabled Treesitter Context", { title = "Option" }) + end + end, + desc = "Toggle Treesitter Context", + }, + }, }, -- Automatically add closing tags for HTML and JSX