From 150523b77b6e848c4135a97a5fd8f6f79a6f4443 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 16 Jul 2024 23:34:27 +0200 Subject: [PATCH 01/18] feat(toggle): make toggles callable. Fixes #4081 --- lua/lazyvim/util/toggle.lua | 56 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index f7287a7b..a74034f4 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -5,17 +5,24 @@ local M = {} ---@field name string ---@field get fun():boolean ---@field set fun(state:boolean) ----@overload fun() -local T = {} -T.__index = T + +---@param toggle lazyvim.Toggle +---@return lazyvim.Toggle|fun():boolean +function M.wrap(toggle) + return setmetatable(toggle, { + __call = function(t) + t.set(not t.get()) + return t.get() + end, + }) +end ---@param lhs string ---@param toggle lazyvim.Toggle function M.map(lhs, toggle) + local t = M.wrap(toggle) LazyVim.safe_keymap_set("n", lhs, function() - local state = not toggle.get() - toggle.set(state) - if state then + if t() then LazyVim.info("Enabled " .. toggle.name, { title = toggle.name }) else LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) @@ -41,8 +48,7 @@ function M.wk(lhs, toggle) }) end ----@type lazyvim.Toggle -M.treesitter = { +M.treesitter = M.wrap({ name = "Treesitter Highlight", get = function() return vim.b.ts_highlight @@ -54,12 +60,11 @@ M.treesitter = { vim.treesitter.stop() end end, -} +}) ---@param buf? boolean function M.format(buf) - ---@type lazyvim.Toggle - local ret = { + return M.wrap({ name = "Auto Format (" .. (buf and "Buffer" or "Global") .. ")", get = function() if not buf then @@ -70,8 +75,7 @@ function M.format(buf) set = function(state) LazyVim.format.enable(state, buf) end, - } - return ret + }) end ---@param opts? {values?: {[1]:any, [2]:any}, name?: string} @@ -80,8 +84,7 @@ function M.option(option, opts) local name = opts.name or option local on = opts.values and opts.values[2] or true local off = opts.values and opts.values[1] or false - ---@type lazyvim.Toggle - local ret = { + return M.wrap({ name = name, get = function() return vim.opt_local[option]:get() == on @@ -89,13 +92,11 @@ function M.option(option, opts) set = function(state) vim.opt_local[option] = state and on or off end, - } - return ret + }) end local nu = { number = true, relativenumber = true } ----@type lazyvim.Toggle -M.number = { +M.number = M.wrap({ name = "Line Numbers", get = function() return vim.opt_local.number:get() or vim.opt_local.relativenumber:get() @@ -110,19 +111,17 @@ M.number = { vim.opt_local.relativenumber = false end end, -} +}) ----@type lazyvim.Toggle -M.diagnostics = { +M.diagnostics = M.wrap({ name = "Diagnostics", get = function() return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled() end, set = vim.diagnostic.enable, -} +}) ----@type lazyvim.Toggle -M.inlay_hints = { +M.inlay_hints = M.wrap({ name = "Inlay Hints", get = function() return vim.lsp.inlay_hint.is_enabled({ bufnr = 0 }) @@ -130,12 +129,11 @@ M.inlay_hints = { set = function(state) vim.lsp.inlay_hint.enable(state, { bufnr = 0 }) end, -} +}) ---@type {k:string, v:any}[] M._maximized = nil ----@type lazyvim.Toggle -M.maximize = { +M.maximize = M.wrap({ name = "Maximize", get = function() return M._maximized ~= nil @@ -170,7 +168,7 @@ M.maximize = { vim.cmd("wincmd =") end end, -} +}) setmetatable(M, { __call = function(m, ...) From 60b10deeb0635a8e54f2ef01504325179bbfd5c7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 16 Jul 2024 23:54:23 +0200 Subject: [PATCH 02/18] style(toggle): types --- lua/lazyvim/util/toggle.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index a74034f4..46dc0bd3 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -6,15 +6,17 @@ local M = {} ---@field get fun():boolean ---@field set fun(state:boolean) +---@class lazyvim.Toggle.wrap: lazyvim.Toggle +---@operator call:boolean + ---@param toggle lazyvim.Toggle ----@return lazyvim.Toggle|fun():boolean function M.wrap(toggle) return setmetatable(toggle, { __call = function(t) t.set(not t.get()) return t.get() end, - }) + }) --[[@as lazyvim.Toggle.wrap]] end ---@param lhs string From bab54406dc312947e4e03bb728498503c09231ca Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 12:40:56 +0200 Subject: [PATCH 03/18] feat(keymaps): proxy leader-w to ctrl-w --- lua/lazyvim/config/keymaps.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index f568bdac..6468864b 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -174,13 +174,11 @@ map("t", "", "close", { desc = "Hide Terminal" }) map("t", "", "close", { desc = "which_key_ignore" }) -- windows -map("n", "ww", "p", { desc = "Other Window", remap = true }) -map("n", "wd", "c", { desc = "Delete Window", remap = true }) -map("n", "w-", "s", { desc = "Split Window Below", remap = true }) -map("n", "w|", "v", { desc = "Split Window Right", remap = true }) +map("n", "w", "", { desc = "Windows", remap = true }) map("n", "-", "s", { desc = "Split Window Below", remap = true }) map("n", "|", "v", { desc = "Split Window Right", remap = true }) -LazyVim.toggle.map("wm", LazyVim.toggle.maximize) +map("n", "d", "c", { desc = "Delete Window", remap = true }) +LazyVim.toggle.map("m", LazyVim.toggle.maximize) -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) From 865bf15f1cf4d4f6a3eda6d7509f94a59752fb36 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 12:42:29 +0200 Subject: [PATCH 04/18] feat(which-key): leader-w-space starts hydra mode for window mappings --- lua/lazyvim/plugins/editor.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 00401e61..a83cf189 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -195,6 +195,13 @@ return { end, desc = "Buffer Keymaps (which-key)", }, + { + "", + function() + require("which-key").show({ keys = "", loop = true }) + end, + desc = "Window Hydra Mode (which-key)", + }, }, config = function(_, opts) local wk = require("which-key") From 66bba787b83afdd85b5ee95aa589fbe9fbb95535 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 12:42:55 +0200 Subject: [PATCH 05/18] feat(which-key): dynamic window mappings under leader-w --- lua/lazyvim/plugins/editor.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index a83cf189..1847bb65 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -177,7 +177,14 @@ return { { "q", group = "quit/session" }, { "s", group = "search" }, { "u", group = "ui", icon = { icon = "󰙵 ", color = "cyan" } }, - { "w", group = "windows" }, + { + "w", + group = "windows", + proxy = "", + expand = function() + return require("which-key.extras").expand.win() + end, + }, { "x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } }, { "[", group = "prev" }, { "]", group = "next" }, From 8d9f2ad97ee0d495135380975438ab8a8ae62b14 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 12:43:12 +0200 Subject: [PATCH 06/18] feat(which-key): dynamic buffer mappings under leader-b --- lua/lazyvim/plugins/editor.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 1847bb65..39108009 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -169,7 +169,13 @@ return { { mode = { "n", "v" }, { "", group = "tabs" }, - { "b", group = "buffer" }, + { + "b", + group = "buffer", + expand = function() + return require("which-key.extras").expand.buf() + end, + }, { "c", group = "code" }, { "f", group = "file/find" }, { "g", group = "git" }, From fd2db9e5eee8f44e703994b303b535e8a38b59ca Mon Sep 17 00:00:00 2001 From: folke Date: Wed, 17 Jul 2024 10:44:14 +0000 Subject: [PATCH 07/18] 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 cd12fa6e..fc9d1472 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 16 +*LazyVim.txt* For Neovim Last change: 2024 July 17 ============================================================================== Table of Contents *LazyVim-table-of-contents* From d263cf5dd1daa3c6b0c07c6fe6cc21b1d39988bb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:48:40 +0200 Subject: [PATCH 08/18] chore(main): release 12.31.0 (#4061) :robot: I have created a release *beep* *boop* --- ## [12.31.0](https://github.com/LazyVim/LazyVim/compare/v12.30.0...v12.31.0) (2024-07-17) ### Features * **keymaps:** proxy leader-w to ctrl-w ([bab5440](https://github.com/LazyVim/LazyVim/commit/bab54406dc312947e4e03bb728498503c09231ca)) * **R:** added new which-key group for new install feature ([#4078](https://github.com/LazyVim/LazyVim/issues/4078)) ([5339aca](https://github.com/LazyVim/LazyVim/commit/5339acacec0996968d64fdbaf9fe8187bfea1b47)) * **toggle:** make toggles callable. Fixes [#4081](https://github.com/LazyVim/LazyVim/issues/4081) ([150523b](https://github.com/LazyVim/LazyVim/commit/150523b77b6e848c4135a97a5fd8f6f79a6f4443)) * **treesitter-context:** which-key toggle ([#4059](https://github.com/LazyVim/LazyVim/issues/4059)) ([ab01350](https://github.com/LazyVim/LazyVim/commit/ab0135093bc18ccf82325bc8ee14c25230a71786)) * **which-key:** dynamic buffer mappings under leader-b ([8d9f2ad](https://github.com/LazyVim/LazyVim/commit/8d9f2ad97ee0d495135380975438ab8a8ae62b14)) * **which-key:** dynamic window mappings under leader-w ([66bba78](https://github.com/LazyVim/LazyVim/commit/66bba787b83afdd85b5ee95aa589fbe9fbb95535)) * **which-key:** leader-w-space starts hydra mode for window mappings ([865bf15](https://github.com/LazyVim/LazyVim/commit/865bf15f1cf4d4f6a3eda6d7509f94a59752fb36)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 1abbe376..99686455 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.30.0" + ".": "12.31.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index f7f74112..bf1c921a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [12.31.0](https://github.com/LazyVim/LazyVim/compare/v12.30.0...v12.31.0) (2024-07-17) + + +### Features + +* **keymaps:** proxy leader-w to ctrl-w ([bab5440](https://github.com/LazyVim/LazyVim/commit/bab54406dc312947e4e03bb728498503c09231ca)) +* **R:** added new which-key group for new install feature ([#4078](https://github.com/LazyVim/LazyVim/issues/4078)) ([5339aca](https://github.com/LazyVim/LazyVim/commit/5339acacec0996968d64fdbaf9fe8187bfea1b47)) +* **toggle:** make toggles callable. Fixes [#4081](https://github.com/LazyVim/LazyVim/issues/4081) ([150523b](https://github.com/LazyVim/LazyVim/commit/150523b77b6e848c4135a97a5fd8f6f79a6f4443)) +* **treesitter-context:** which-key toggle ([#4059](https://github.com/LazyVim/LazyVim/issues/4059)) ([ab01350](https://github.com/LazyVim/LazyVim/commit/ab0135093bc18ccf82325bc8ee14c25230a71786)) +* **which-key:** dynamic buffer mappings under leader-b ([8d9f2ad](https://github.com/LazyVim/LazyVim/commit/8d9f2ad97ee0d495135380975438ab8a8ae62b14)) +* **which-key:** dynamic window mappings under leader-w ([66bba78](https://github.com/LazyVim/LazyVim/commit/66bba787b83afdd85b5ee95aa589fbe9fbb95535)) +* **which-key:** leader-w-space starts hydra mode for window mappings ([865bf15](https://github.com/LazyVim/LazyVim/commit/865bf15f1cf4d4f6a3eda6d7509f94a59752fb36)) + ## [12.30.0](https://github.com/LazyVim/LazyVim/compare/v12.29.2...v12.30.0) (2024-07-15) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 08029fc9..abe2ff6e 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.30.0" -- x-release-please-version +M.version = "12.31.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From c1b76ee235a2cccff6370ecfca57bdacd5fe6258 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 15:06:45 +0200 Subject: [PATCH 09/18] feat(toggle): move toggle notifs to toggle function --- lua/lazyvim/util/toggle.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 46dc0bd3..c8027666 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -12,9 +12,15 @@ local M = {} ---@param toggle lazyvim.Toggle function M.wrap(toggle) return setmetatable(toggle, { - __call = function(t) - t.set(not t.get()) - return t.get() + __call = function() + toggle.set(not toggle.get()) + local state = toggle.get() + if state then + LazyVim.info("Enabled " .. toggle.name, { title = toggle.name }) + else + LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) + end + return state end, }) --[[@as lazyvim.Toggle.wrap]] end @@ -24,11 +30,7 @@ end function M.map(lhs, toggle) local t = M.wrap(toggle) LazyVim.safe_keymap_set("n", lhs, function() - if t() then - LazyVim.info("Enabled " .. toggle.name, { title = toggle.name }) - else - LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) - end + t() end, { desc = "Toggle " .. toggle.name }) M.wk(lhs, toggle) end From b1a47405b9fa5eb9f5222876e81be73206b80792 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 00:21:19 +0200 Subject: [PATCH 10/18] feat(edgy): added support for grug-far.nvim --- lua/lazyvim/plugins/extras/ui/edgy.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index cb2c7358..f63e31ad 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -56,6 +56,9 @@ return { { title = "Neotest Summary", ft = "neotest-summary" }, -- "neo-tree", }, + right = { + { title = "Grug Far", ft = "grug-far", size = { width = 0.4 } }, + }, keys = { -- increase width [""] = function(win) From d6561fd27c17806ca972cbfc18573ca81d13e346 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 00:41:54 +0200 Subject: [PATCH 11/18] fix(autcmds): desc for close_with_q --- lua/lazyvim/config/autocmds.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index f9a83c82..1440d069 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -71,7 +71,11 @@ vim.api.nvim_create_autocmd("FileType", { }, callback = function(event) vim.bo[event.buf].buflisted = false - vim.keymap.set("n", "q", "close", { buffer = event.buf, silent = true }) + vim.keymap.set("n", "q", "close", { + buffer = event.buf, + silent = true, + desc = "Quit buffer", + }) end, }) From b5290fd92935d2e96fa2249cfd09bdd853972869 Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Thu, 18 Jul 2024 08:10:22 +0300 Subject: [PATCH 12/18] feat(terminal): clear search highlight when opening a terminal (#4090) ## Description Often times when opening a terminal or lazygit when a search is active, words in the terminal are highlighted. In my opinion this is rarely, if not never intended. This attempts to fixes this behavior. The code of `terminal.lua` is a bit beyond me, but I believe I have added it to the right place. ## Related Issue(s) N/A. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/terminal.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/util/terminal.lua b/lua/lazyvim/util/terminal.lua index 598f8ffc..87f8553b 100644 --- a/lua/lazyvim/util/terminal.lua +++ b/lua/lazyvim/util/terminal.lua @@ -87,6 +87,8 @@ function M.open(cmd, opts) vim.cmd.startinsert() end, }) + + vim.cmd("noh") end return terminals[termkey] From 87ef93e8a015b4737c5f269f350a790b4f61c907 Mon Sep 17 00:00:00 2001 From: folke Date: Thu, 18 Jul 2024 05:11:12 +0000 Subject: [PATCH 13/18] 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 fc9d1472..fcd74ffc 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 17 +*LazyVim.txt* For Neovim Last change: 2024 July 18 ============================================================================== Table of Contents *LazyVim-table-of-contents* From d2483f19cee5234db1e010e6560d9aa9bb60bb30 Mon Sep 17 00:00:00 2001 From: Jeremy Pridemore Date: Wed, 17 Jul 2024 23:21:50 -0600 Subject: [PATCH 14/18] feat(lualine): allow for trouble_lualine to be overriden on buffer (#4096) ## Description Right now there is a default `vim.g.trouble_lualine` being set to `true`, and only that variable is being checked when deciding if the trouble output is being appended to the `lualine_c` for the lualine plugin. This is normally nice in code files, where you can get output like `packages/src/index.ts > myFunction` but in some filetypes, the user may not wish for this. In particular, I found if you have files with the `markdown` type that include long headers, then you can easily lose the file name by it trying to include the headers in this location. Considering that one of the `CONTRIBUTING.md` guidelines is `Ensure all configurations are overridable by the user, using Lazy's specs.`, I figured that allowing this to be overrideable at the user's discretion could be a valuable feature. This would allow the user to override this on file type by including an autocmd like this in their `lua/config/autocmds.lua` or equivalent: ```lua -- disable trouble symbols in lualine in text filetypes vim.api.nvim_create_autocmd("FileType", { group = vim.api.nvim_create_augroup("disable_trouble_lualine", { clear = true }), pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" }, callback = function() vim.b.trouble_lualine = false end, }) ``` ## Related Issue(s) None ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: jpridemore-allegion --- lua/lazyvim/plugins/ui.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 14a77ce4..6455658d 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -198,7 +198,12 @@ return { } -- do not add trouble symbols if aerial is enabled - if vim.g.trouble_lualine and LazyVim.has("trouble.nvim") then + -- And allow it to be overriden for some buffer types (see autocmds) + if + vim.g.trouble_luline_enabed ~= false + and vim.b.trouble_lualine_enabled ~= false + and LazyVim.has("trouble.nvim") + then local trouble = require("trouble") local symbols = trouble.statusline and trouble.statusline({ From 4ac249beaae3462d606128ca21db79cb85a8c65b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 09:30:56 +0200 Subject: [PATCH 15/18] fix(ui): typo --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 6455658d..7b43551a 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -200,7 +200,7 @@ return { -- do not add trouble symbols if aerial is enabled -- And allow it to be overriden for some buffer types (see autocmds) if - vim.g.trouble_luline_enabed ~= false + vim.g.trouble_lualine_enabed ~= false and vim.b.trouble_lualine_enabled ~= false and LazyVim.has("trouble.nvim") then From b8bdebe5be7eba91db23e43575fc1226075f6a56 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 10:42:02 +0200 Subject: [PATCH 16/18] fix(ui): another typo --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 7b43551a..bbffe75f 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -200,7 +200,7 @@ return { -- do not add trouble symbols if aerial is enabled -- And allow it to be overriden for some buffer types (see autocmds) if - vim.g.trouble_lualine_enabed ~= false + vim.g.trouble_lualine_enabled ~= false and vim.b.trouble_lualine_enabled ~= false and LazyVim.has("trouble.nvim") then From 0daa957b3c8e672c9608bda7cd737cd8090adf80 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 10:48:31 +0200 Subject: [PATCH 17/18] chore(main): release 12.32.0 (#4086) :robot: I have created a release *beep* *boop* --- ## [12.32.0](https://github.com/LazyVim/LazyVim/compare/v12.31.0...v12.32.0) (2024-07-18) ### Features * **edgy:** added support for grug-far.nvim ([b1a4740](https://github.com/LazyVim/LazyVim/commit/b1a47405b9fa5eb9f5222876e81be73206b80792)) * **terminal:** clear search highlight when opening a terminal ([#4090](https://github.com/LazyVim/LazyVim/issues/4090)) ([b5290fd](https://github.com/LazyVim/LazyVim/commit/b5290fd92935d2e96fa2249cfd09bdd853972869)) * **toggle:** move toggle notifs to toggle function ([c1b76ee](https://github.com/LazyVim/LazyVim/commit/c1b76ee235a2cccff6370ecfca57bdacd5fe6258)) ### Bug Fixes * **autcmds:** desc for close_with_q ([d6561fd](https://github.com/LazyVim/LazyVim/commit/d6561fd27c17806ca972cbfc18573ca81d13e346)) * **ui:** another typo ([b8bdebe](https://github.com/LazyVim/LazyVim/commit/b8bdebe5be7eba91db23e43575fc1226075f6a56)) * **ui:** typo ([4ac249b](https://github.com/LazyVim/LazyVim/commit/4ac249beaae3462d606128ca21db79cb85a8c65b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 99686455..9f92a4d3 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.31.0" + ".": "12.32.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index bf1c921a..b148a091 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [12.32.0](https://github.com/LazyVim/LazyVim/compare/v12.31.0...v12.32.0) (2024-07-18) + + +### Features + +* **edgy:** added support for grug-far.nvim ([b1a4740](https://github.com/LazyVim/LazyVim/commit/b1a47405b9fa5eb9f5222876e81be73206b80792)) +* **terminal:** clear search highlight when opening a terminal ([#4090](https://github.com/LazyVim/LazyVim/issues/4090)) ([b5290fd](https://github.com/LazyVim/LazyVim/commit/b5290fd92935d2e96fa2249cfd09bdd853972869)) +* **toggle:** move toggle notifs to toggle function ([c1b76ee](https://github.com/LazyVim/LazyVim/commit/c1b76ee235a2cccff6370ecfca57bdacd5fe6258)) + + +### Bug Fixes + +* **autcmds:** desc for close_with_q ([d6561fd](https://github.com/LazyVim/LazyVim/commit/d6561fd27c17806ca972cbfc18573ca81d13e346)) +* **ui:** another typo ([b8bdebe](https://github.com/LazyVim/LazyVim/commit/b8bdebe5be7eba91db23e43575fc1226075f6a56)) +* **ui:** typo ([4ac249b](https://github.com/LazyVim/LazyVim/commit/4ac249beaae3462d606128ca21db79cb85a8c65b)) + ## [12.31.0](https://github.com/LazyVim/LazyVim/compare/v12.30.0...v12.31.0) (2024-07-17) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index abe2ff6e..a95f519f 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.31.0" -- x-release-please-version +M.version = "12.32.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From f9fdb356f2362e5ae4ef490944b1957b49dc6680 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 15:45:53 +0200 Subject: [PATCH 18/18] fix(ui): trouble lualine component --- lua/lazyvim/config/options.lua | 1 + lua/lazyvim/plugins/ui.lua | 27 ++++++++++++--------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 5c66966a..a8d512fc 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -47,6 +47,7 @@ vim.g.deprecation_warnings = false vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB -- Show the current document symbols location from Trouble in lualine +-- You can disable this for a buffer by setting `vim.b.trouble_lualine = false` vim.g.trouble_lualine = true local opt = vim.opt diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index bbffe75f..ed17182d 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -199,24 +199,21 @@ return { -- do not add trouble symbols if aerial is enabled -- And allow it to be overriden for some buffer types (see autocmds) - if - vim.g.trouble_lualine_enabled ~= false - and vim.b.trouble_lualine_enabled ~= false - and LazyVim.has("trouble.nvim") - then + if vim.g.trouble_lualine and LazyVim.has("trouble.nvim") then local trouble = require("trouble") - local symbols = trouble.statusline - and trouble.statusline({ - mode = "symbols", - groups = {}, - title = false, - filter = { range = true }, - format = "{kind_icon}{symbol.name:Normal}", - hl_group = "lualine_c_normal", - }) + local symbols = trouble.statusline({ + mode = "symbols", + groups = {}, + title = false, + filter = { range = true }, + format = "{kind_icon}{symbol.name:Normal}", + hl_group = "lualine_c_normal", + }) table.insert(opts.sections.lualine_c, { symbols and symbols.get, - cond = symbols and symbols.has, + cond = function() + return vim.b.trouble_lualine ~= false and symbols.has() + end, }) end