From a0010ae5492c8a92eb42b4e21a776ea08f1cada9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 18:20:09 +0200 Subject: [PATCH] feat(ui)!: moved treesitter-context to an extra. No longer a core plugin --- lua/lazyvim/plugins/editor.lua | 1 - .../plugins/extras/ui/treesitter-context.lua | 21 +++++++++++++++++ lua/lazyvim/plugins/treesitter.lua | 23 ------------------- 3 files changed, 21 insertions(+), 24 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/ui/treesitter-context.lua diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 95267532..61f9cd86 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -452,7 +452,6 @@ return { -- buffer remove { "echasnovski/mini.bufremove", - keys = { { "bd", diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-context.lua b/lua/lazyvim/plugins/extras/ui/treesitter-context.lua new file mode 100644 index 00000000..a1f8d5f3 --- /dev/null +++ b/lua/lazyvim/plugins/extras/ui/treesitter-context.lua @@ -0,0 +1,21 @@ +-- Show context of the current function +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", + }, + }, +} diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 97479b91..19aef89b 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -118,29 +118,6 @@ return { end, }, - -- Show context of the current function - { - "nvim-treesitter/nvim-treesitter-context", - event = "LazyFile", - enabled = true, - 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", - }, - }, - }, - -- Automatically add closing tags for HTML and JSX { "windwp/nvim-ts-autotag",