From c20880fc7d54bfa7db0832320ec76916651b6a5f Mon Sep 17 00:00:00 2001 From: Marcelo Jacobus Date: Sun, 29 Jun 2025 21:04:02 -0300 Subject: [PATCH] Add treesitter context --- lua/plugins/treesitter-context.lua | 21 +++++++++++++++++++++ old/lua/plugins/treesitter-context.lua | 20 -------------------- 2 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 lua/plugins/treesitter-context.lua delete mode 100644 old/lua/plugins/treesitter-context.lua diff --git a/lua/plugins/treesitter-context.lua b/lua/plugins/treesitter-context.lua new file mode 100644 index 0000000..5cbf2de --- /dev/null +++ b/lua/plugins/treesitter-context.lua @@ -0,0 +1,21 @@ +return { + "nvim-treesitter/nvim-treesitter-context", + -- event = "LazyFile", + opts = { mode = "cursor", max_lines = 3 }, + keys = { + { + "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", + }, + }, +} diff --git a/old/lua/plugins/treesitter-context.lua b/old/lua/plugins/treesitter-context.lua deleted file mode 100644 index df1f36c..0000000 --- a/old/lua/plugins/treesitter-context.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter-context", - event = "LazyFile", - opts = { mode = "cursor", max_lines = 3 }, - keys = { - { - "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", - }, - }, -}