From 0e8069c78ee92279055236388df8c2019476767a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 10 Oct 2025 06:45:12 +0200 Subject: [PATCH 1/4] feat(treesitter): added support for `disable` langs to indent/highlight/folds. Closes #6608 --- lua/lazyvim/plugins/treesitter.lua | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 78f1b3b2..b53e9c37 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -21,12 +21,13 @@ return { event = { "LazyFile", "VeryLazy" }, cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" }, opts_extend = { "ensure_installed" }, + ---@alias lazyvim.TSFeat { enable?: boolean, disable?: string[] } ---@class lazyvim.TSConfig: TSConfig opts = { -- LazyVim config for treesitter - indent = { enable = true }, - highlight = { enable = true }, - folds = { enable = true }, + indent = { enable = true }, ---@type lazyvim.TSFeat + highlight = { enable = true }, ---@type lazyvim.TSFeat + folds = { enable = true }, ---@type lazyvim.TSFeat ensure_installed = { "bash", "c", @@ -99,22 +100,32 @@ return { vim.api.nvim_create_autocmd("FileType", { group = vim.api.nvim_create_augroup("lazyvim_treesitter", { clear = true }), callback = function(ev) - if not LazyVim.treesitter.have(ev.match) then + local ft, lang = ev.match, vim.treesitter.language.get_lang(ev.match) + if not LazyVim.treesitter.have(ft) then return end + ---@param feat string + ---@param query string + local function enabled(feat, query) + local f = opts[feat] or {} ---@type lazyvim.TSFeat + return f.enable ~= false + and not vim.tbl_contains(f.disable or {}, lang) + and LazyVim.treesitter.have(ft, query) + end + -- highlighting - if vim.tbl_get(opts, "highlight", "enable") ~= false then + if enabled("highlight", "highlights") then pcall(vim.treesitter.start) end -- indents - if vim.tbl_get(opts, "indent", "enable") ~= false and LazyVim.treesitter.have(ev.match, "indents") then + if enabled("indent", "indents") then LazyVim.set_default("indentexpr", "v:lua.LazyVim.treesitter.indentexpr()") end -- folds - if vim.tbl_get(opts, "folds", "enable") ~= false and LazyVim.treesitter.have(ev.match, "folds") then + if enabled("folds", "folds") then if LazyVim.set_default("foldmethod", "expr") then LazyVim.set_default("foldexpr", "v:lua.LazyVim.treesitter.foldexpr()") end From c1aef3b62a21e0525c12681e28a64a2b7950d7d6 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Fri, 10 Oct 2025 04:46:21 +0000 Subject: [PATCH 2/4] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 4398c40a..ec2f0a19 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 October 09 +*LazyVim.txt* For Neovim Last change: 2025 October 10 ============================================================================== Table of Contents *LazyVim-table-of-contents* From e8c5fa7eae06539c883699507caeadb46d74f401 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 10 Oct 2025 20:57:42 +0200 Subject: [PATCH 3/4] fix(treesiter): check that `disable` options are tables --- lua/lazyvim/plugins/treesitter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index b53e9c37..5106da4e 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -110,7 +110,7 @@ return { local function enabled(feat, query) local f = opts[feat] or {} ---@type lazyvim.TSFeat return f.enable ~= false - and not vim.tbl_contains(f.disable or {}, lang) + and not (type(f.disable) == "table" and vim.tbl_contains(f.disable, lang)) and LazyVim.treesitter.have(ft, query) end From f8b062b130177f07d3c1c13b642402d42e980df5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 11 Oct 2025 00:05:16 +0200 Subject: [PATCH 4/4] feat(sidekick): added `ad` to close/detach a terminal/session --- lua/lazyvim/plugins/extras/ai/sidekick.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ai/sidekick.lua b/lua/lazyvim/plugins/extras/ai/sidekick.lua index 52597b0e..5b2c0976 100644 --- a/lua/lazyvim/plugins/extras/ai/sidekick.lua +++ b/lua/lazyvim/plugins/extras/ai/sidekick.lua @@ -74,6 +74,11 @@ return { -- require("sidekick.cli").select({ filter = { installed = true } }) desc = "Select CLI", }, + { + "ad", + function() require("sidekick.cli").close() end, + desc = "Detach a CLI Session", + }, { "at", function() require("sidekick.cli").send({ msg = "{this}" }) end,