From 8506cb5a98a528651a5557d8e447fa13bd8ac0cb Mon Sep 17 00:00:00 2001 From: Johnson Hu Date: Mon, 15 Jul 2024 15:06:34 +0800 Subject: [PATCH 01/71] feat(util.mini): follow the user's mappings instead of hardcoded values (#4043) Because I use the Colemak-DH keyboard layout, I have mapped 'i' to 'h'. Therefore, the current mini.ai which_key prompts are inconsistent with my keymap. ## Description The names and prefixes used in mini.ai_whichkey() are hardcoded and should follow the user's mappings. ## Related Issue(s) No ## Screenshots No ## Checklist - [ x ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/coding.lua | 11 ++++++++--- lua/lazyvim/util/mini.lua | 25 ++++++++++++++++--------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index ffd743b3..e4ce97d2 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -171,9 +171,6 @@ return { "echasnovski/mini.ai", event = "VeryLazy", opts = function() - LazyVim.on_load("which-key.nvim", function() - vim.schedule(LazyVim.mini.ai_whichkey) - end) local ai = require("mini.ai") return { n_lines = 500, @@ -197,6 +194,14 @@ return { }, } end, + config = function(_, opts) + require("mini.ai").setup(opts) + LazyVim.on_load("which-key.nvim", function() + vim.schedule(function() + LazyVim.mini.ai_whichkey(opts) + end) + end) + end, }, { diff --git a/lua/lazyvim/util/mini.lua b/lua/lazyvim/util/mini.lua index cdb27397..28c069da 100644 --- a/lua/lazyvim/util/mini.lua +++ b/lua/lazyvim/util/mini.lua @@ -60,7 +60,8 @@ function M.ai_buffer(ai_type) end -- register all text objects with which-key -function M.ai_whichkey() +---@param opts table +function M.ai_whichkey(opts) local objects = { { " ", desc = "whitespace" }, { '"', desc = '" string' }, @@ -92,14 +93,20 @@ function M.ai_whichkey() } local ret = { mode = { "o", "x" } } - for prefix, name in pairs({ - i = "inside", - a = "around", - il = "last", - ["in"] = "next", - al = "last", - an = "next", - }) do + ---@type table + local mappings = vim.tbl_extend("force", {}, { + around = "a", + inside = "i", + around_next = "an", + inside_next = "in", + around_last = "al", + inside_last = "il", + }, opts.mappings or {}) + mappings.goto_left = nil + mappings.goto_right = nil + + for name, prefix in pairs(mappings) do + name = name:gsub("^around_", ""):gsub("^inside_", "") ret[#ret + 1] = { prefix, group = name } for _, obj in ipairs(objects) do local desc = obj.desc From 448e15862aff675add1116ac2d62a0e743b7c9cd Mon Sep 17 00:00:00 2001 From: folke Date: Mon, 15 Jul 2024 07:07:24 +0000 Subject: [PATCH 02/71] 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 50f726a8..30cdbd12 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 14 +*LazyVim.txt* For Neovim Last change: 2024 July 15 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 0f2d01dd0121b4406ef877089877ad3f3f14e3a3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 11:19:44 +0200 Subject: [PATCH 03/71] chore(update): update repository (#4047) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5d032ebd..16bf6ed1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -17,6 +17,8 @@ body: options: - label: I have read all the LazyVim docs required: true + - label: I have updated the plugin to the latest version before submitting this issue + required: true - label: I have searched the existing issues of LazyVim required: true - label: I have searched the existing issues of plugins related to this issue From 6911327a5edca85ce3bc71229236494d9af7fafa Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio Date: Mon, 15 Jul 2024 11:48:58 +0200 Subject: [PATCH 04/71] fix(yanky): enable yank history in visual mode (#4048) ## Description Being able to select from the yank history is useful if you want to paste over something else by first selecting the stuff you want to remove in visual mode. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/coding/yanky.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index fbf8f9ef..c880aceb 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -17,6 +17,7 @@ return { vim.cmd([[YankyRingHistory]]) end end, + mode = { "n", "x" }, desc = "Open Yank History", }, -- stylua: ignore From 706ec4b6b6be4265cbcfd326d3216f2a29952b55 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Jul 2024 14:05:49 +0200 Subject: [PATCH 05/71] fix(lsp): lsp keymaps. Fixes #4051 --- lua/lazyvim/plugins/lsp/keymaps.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 12ae59be..2a35dc97 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -14,10 +14,10 @@ function M.get() -- stylua: ignore M._keys = { { "cl", "LspInfo", desc = "Lsp Info" }, - { "gd", vim.lsp.buf.definition(), desc = "Goto Definition", has = "definition" }, - { "gr", vim.lsp.buf.references(), desc = "References", nowait = true }, - { "gI", vim.lsp.buf.implementation(), desc = "Goto Implementation" }, - { "gy", vim.lsp.buf.type_definition(), desc = "Goto T[y]pe Definition" }, + { "gd", vim.lsp.buf.definition, desc = "Goto Definition", has = "definition" }, + { "gr", vim.lsp.buf.references, desc = "References", nowait = true }, + { "gI", vim.lsp.buf.implementation, desc = "Goto Implementation" }, + { "gy", vim.lsp.buf.type_definition, desc = "Goto T[y]pe Definition" }, { "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" }, { "K", vim.lsp.buf.hover, desc = "Hover" }, { "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" }, From 78cf0320bfc34050883cde5e7af267184dc60ee9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Jul 2024 15:47:44 +0200 Subject: [PATCH 06/71] feat(keymaps): dynamic which-key icons/descriptions for toggles (#4050) ## Description ## Related Issue(s) - [ ] Closes #4025 ## Screenshots ![image](https://github.com/user-attachments/assets/8453c23c-d560-490c-9f96-a22ea88f45fd) ## Checklist - [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/config/keymaps.lua | 27 +- lua/lazyvim/plugins/coding.lua | 14 - lua/lazyvim/plugins/editor.lua | 6 +- .../plugins/extras/ui/mini-animate.lua | 10 + lua/lazyvim/plugins/lsp/init.lua | 7 +- lua/lazyvim/plugins/treesitter.lua | 10 + lua/lazyvim/util/format.lua | 13 +- lua/lazyvim/util/mini.lua | 9 + lua/lazyvim/util/toggle.lua | 252 +++++++++++------- 9 files changed, 217 insertions(+), 131 deletions(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 48ae24f8..f568bdac 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -115,20 +115,19 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" }) -- stylua: ignore start -- toggle options -map("n", "uf", function() LazyVim.format.toggle() end, { desc = "Toggle Auto Format (Global)" }) -map("n", "uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle Auto Format (Buffer)" }) -map("n", "us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" }) -map("n", "uw", function() LazyVim.toggle("wrap") end, { desc = "Toggle Word Wrap" }) -map("n", "uL", function() LazyVim.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" }) -map("n", "ul", function() LazyVim.toggle.number() end, { desc = "Toggle Line Numbers" }) -map("n", "ud", function() LazyVim.toggle.diagnostics() end, { desc = "Toggle Diagnostics" }) -local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3 -map("n", "uc", function() LazyVim.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" }) -if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then - map( "n", "uh", function() LazyVim.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" }) +LazyVim.toggle.map("uf", LazyVim.toggle.format()) +LazyVim.toggle.map("uF", LazyVim.toggle.format(true)) +LazyVim.toggle.map("us", LazyVim.toggle("spell", { name = "Spelling" })) +LazyVim.toggle.map("uw", LazyVim.toggle("wrap", { name = "Wrap" })) +LazyVim.toggle.map("uL", LazyVim.toggle("relativenumber", { name = "Relative Number" })) +LazyVim.toggle.map("ud", LazyVim.toggle.diagnostics) +LazyVim.toggle.map("ul", LazyVim.toggle.number) +LazyVim.toggle.map( "uc", LazyVim.toggle("conceallevel", { values = { 0, vim.o.conceallevel > 0 and vim.o.conceallevel or 2 } })) +LazyVim.toggle.map("uT", LazyVim.toggle.treesitter) +LazyVim.toggle.map("ub", LazyVim.toggle("background", { values = { "light", "dark" }, name = "Background" })) +if vim.lsp.inlay_hint then + LazyVim.toggle.map("uh", LazyVim.toggle.inlay_hints) end -map("n", "uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" }) -map("n", "ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" }) -- lazygit map("n", "gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" }) @@ -181,7 +180,7 @@ map("n", "w-", "s", { desc = "Split Window Below", remap = true }) map("n", "w|", "v", { desc = "Split Window Right", remap = true }) map("n", "-", "s", { desc = "Split Window Below", remap = true }) map("n", "|", "v", { desc = "Split Window Right", remap = true }) -map("n", "wm", function() LazyVim.toggle.maximize() end, { desc = "Maximize Toggle" }) +LazyVim.toggle.map("wm", LazyVim.toggle.maximize) -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index e4ce97d2..8b982033 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -140,20 +140,6 @@ return { -- better deal with markdown code blocks markdown = true, }, - keys = { - { - "up", - function() - vim.g.minipairs_disable = not vim.g.minipairs_disable - if vim.g.minipairs_disable then - LazyVim.warn("Disabled auto pairs", { title = "Option" }) - else - LazyVim.info("Enabled auto pairs", { title = "Option" }) - end - end, - desc = "Toggle Auto Pairs", - }, - }, config = function(_, opts) LazyVim.mini.pairs(opts) end, diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 5bdbcb12..00401e61 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -176,9 +176,9 @@ return { { "gh", group = "hunks" }, { "q", group = "quit/session" }, { "s", group = "search" }, - { "u", group = "ui" }, + { "u", group = "ui", icon = { icon = "󰙵 ", color = "cyan" } }, { "w", group = "windows" }, - { "x", group = "diagnostics/quickfix" }, + { "x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } }, { "[", group = "prev" }, { "]", group = "next" }, { "g", group = "goto" }, @@ -193,7 +193,7 @@ return { function() require("which-key").show({ global = false }) end, - desc = "Buffer Local Keymaps (which-key)", + desc = "Buffer Keymaps (which-key)", }, }, config = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/ui/mini-animate.lua b/lua/lazyvim/plugins/extras/ui/mini-animate.lua index c1f44d6d..571bee26 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-animate.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-animate.lua @@ -14,6 +14,16 @@ return { end, { expr = true }) end + LazyVim.toggle.map("ua", { + name = "Mini Animate", + get = function() + return not vim.g.minianimate_disable + end, + set = function(state) + vim.g.minianimate_disable = not state + end, + }) + local animate = require("mini.animate") return { resize = { diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 5e6f3543..0747547f 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -7,9 +7,9 @@ return { "mason.nvim", { "williamboman/mason-lspconfig.nvim", config = function() end }, }, - ---@class PluginLspOpts opts = function() - return { + ---@class PluginLspOpts + local ret = { -- options for vim.diagnostic.config() ---@type vim.diagnostic.Opts diagnostics = { @@ -114,6 +114,7 @@ return { -- ["*"] = function(server, opts) end, }, } + return ret end, ---@param opts PluginLspOpts config = function(_, opts) @@ -150,7 +151,7 @@ return { and vim.bo[buffer].buftype == "" and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype) then - LazyVim.toggle.inlay_hints(buffer, true) + vim.lsp.inlay_hint.enable(true, { bufnr = buffer }) end end) end diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 7bd2d091..0f0c8fe8 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -1,4 +1,14 @@ return { + { + "folke/which-key.nvim", + opts = { + spec = { + { "", desc = "Decrement Selection", mode = "x" }, + { "", desc = "Increment Selection", mode = { "x", "n" } }, + }, + }, + }, + -- Treesitter is a new parser generator tool that we can -- use in Neovim to power faster and more accurate -- syntax highlighting. diff --git a/lua/lazyvim/util/format.lua b/lua/lazyvim/util/format.lua index e6325538..de6ad052 100644 --- a/lua/lazyvim/util/format.lua +++ b/lua/lazyvim/util/format.lua @@ -97,10 +97,19 @@ end ---@param buf? boolean function M.toggle(buf) + M.enable(not M.enabled(), buf) +end + +---@param enable? boolean +---@param buf? boolean +function M.enable(enable, buf) + if enable == nil then + enable = true + end if buf then - vim.b.autoformat = not M.enabled() + vim.b.autoformat = enable else - vim.g.autoformat = not M.enabled() + vim.g.autoformat = enable vim.b.autoformat = nil end M.info() diff --git a/lua/lazyvim/util/mini.lua b/lua/lazyvim/util/mini.lua index 28c069da..e7320a73 100644 --- a/lua/lazyvim/util/mini.lua +++ b/lua/lazyvim/util/mini.lua @@ -121,6 +121,15 @@ end ---@param opts {skip_next: string, skip_ts: string[], skip_unbalanced: boolean, markdown: boolean} function M.pairs(opts) + LazyVim.toggle.map("up", { + name = "Mini Pairs", + get = function() + return not vim.g.minipairs_disable + end, + set = function(state) + vim.g.minipairs_disable = not state + end, + }) local pairs = require("mini.pairs") pairs.setup(opts) local open = pairs.open diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 95bb3e76..99721e06 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -1,114 +1,176 @@ ---@class lazyvim.util.toggle local M = {} ----@param silent boolean? ----@param values? {[1]:any, [2]:any} -function M.option(option, silent, values) - if values then - if vim.opt_local[option]:get() == values[1] then - ---@diagnostic disable-next-line: no-unknown - vim.opt_local[option] = values[2] +---@class lazyvim.Toggle +---@field name string +---@field get fun():boolean +---@field set fun(state:boolean) +---@overload fun() +local T = {} +T.__index = T + +---@param lhs string +---@param toggle lazyvim.Toggle +function M.map(lhs, toggle) + LazyVim.safe_keymap_set("n", lhs, function() + local state = not toggle.get() + toggle.set(state) + if state then + LazyVim.info("Enabled " .. toggle.name, { title = toggle.name }) else - ---@diagnostic disable-next-line: no-unknown - vim.opt_local[option] = values[1] + LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) end - return LazyVim.info("Set " .. option .. " to " .. vim.opt_local[option]:get(), { title = "Option" }) + end, { desc = "Toggle" .. toggle.name }) + M.wk(lhs, toggle) +end + +function M.wk(lhs, toggle) + if not LazyVim.has("which-key.nvim") then + return end - ---@diagnostic disable-next-line: no-unknown - vim.opt_local[option] = not vim.opt_local[option]:get() - if not silent then - if vim.opt_local[option]:get() then - LazyVim.info("Enabled " .. option, { title = "Option" }) + require("which-key").add({ + { + lhs, + icon = function() + return toggle.get() and { icon = " ", color = "green" } or { icon = " ", color = "yellow" } + end, + desc = function() + return (toggle.get() and "Disable " or "Enable ") .. toggle.name + end, + }, + }) +end + +---@type lazyvim.Toggle +M.treesitter = { + name = "Treesitter Highlight", + get = function() + return vim.b.ts_highlight + end, + set = function(state) + if state then + vim.treesitter.start() else - LazyVim.warn("Disabled " .. option, { title = "Option" }) + vim.treesitter.stop() end - end + end, +} + +---@param buf? boolean +function M.format(buf) + ---@type lazyvim.Toggle + local ret = { + name = "Auto Format (" .. (buf and "Buffer" or "Global") .. ")", + get = function() + if not buf then + return vim.g.autoformat == nil or vim.g.autoformat + end + return LazyVim.format.enabled() + end, + set = function(state) + LazyVim.format.enable(state, buf) + end, + } + return ret +end + +---@param opts? {values?: {[1]:any, [2]:any}, name?: string} +function M.option(option, opts) + opts = opts or {} + 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 = { + name = name, + get = function() + return vim.opt_local[option]:get() == on + end, + set = function(state) + vim.opt_local[option] = state and on or off + end, + } + return ret end local nu = { number = true, relativenumber = true } -function M.number() - if vim.opt_local.number:get() or vim.opt_local.relativenumber:get() then - nu = { number = vim.opt_local.number:get(), relativenumber = vim.opt_local.relativenumber:get() } - vim.opt_local.number = false - vim.opt_local.relativenumber = false - LazyVim.warn("Disabled line numbers", { title = "Option" }) - else - vim.opt_local.number = nu.number - vim.opt_local.relativenumber = nu.relativenumber - LazyVim.info("Enabled line numbers", { title = "Option" }) - end -end - -local enabled = true -function M.diagnostics() - -- if this Neovim version supports checking if diagnostics are enabled - -- then use that for the current state - if vim.diagnostic.is_enabled then - enabled = vim.diagnostic.is_enabled() - elseif vim.diagnostic.is_disabled then - enabled = not vim.diagnostic.is_disabled() - end - enabled = not enabled - - if enabled then - vim.diagnostic.enable() - LazyVim.info("Enabled diagnostics", { title = "Diagnostics" }) - else - vim.diagnostic.disable() - LazyVim.warn("Disabled diagnostics", { title = "Diagnostics" }) - end -end - ----@param buf? number ----@param value? boolean -function M.inlay_hints(buf, value) - local ih = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint - if type(ih) == "function" then - ih(buf, value) - elseif type(ih) == "table" and ih.enable then - if value == nil then - value = not ih.is_enabled({ bufnr = buf or 0 }) +---@type lazyvim.Toggle +M.number = { + name = "Line Numbers", + get = function() + return vim.opt_local.number:get() or vim.opt_local.relativenumber:get() + end, + set = function(state) + if state then + vim.opt_local.number = nu.number + vim.opt_local.relativenumber = nu.relativenumber + else + nu = { number = vim.opt_local.number:get(), relativenumber = vim.opt_local.relativenumber:get() } + vim.opt_local.number = false + vim.opt_local.relativenumber = false end - ih.enable(value, { bufnr = buf }) - end -end + end, +} + +---@type lazyvim.Toggle +M.diagnostics = { + 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 = { + name = "Inlay Hints", + get = function() + return vim.lsp.inlay_hint.is_enabled({ bufnr = 0 }) + end, + set = function(state) + vim.lsp.inlay_hint.enable(state, { bufnr = 0 }) + end, +} ---@type {k:string, v:any}[] M._maximized = nil ----@param state boolean? -function M.maximize(state) - if state == (M._maximized ~= nil) then - return - end - if M._maximized then - for _, opt in ipairs(M._maximized) do - vim.o[opt.k] = opt.v +---@type lazyvim.Toggle +M.maximize = { + name = "Maximize", + get = function() + return M._maximized ~= nil + end, + set = function(state) + if state then + M._maximized = {} + local function set(k, v) + table.insert(M._maximized, 1, { k = k, v = vim.o[k] }) + vim.o[k] = v + end + set("winwidth", 999) + set("winheight", 999) + set("winminwidth", 10) + set("winminheight", 4) + vim.cmd("wincmd =") + -- `QuitPre` seems to be executed even if we quit a normal window, so we don't want that + -- `VimLeavePre` might be another consideration? Not sure about differences between the 2 + vim.api.nvim_create_autocmd("ExitPre", { + once = true, + group = vim.api.nvim_create_augroup("lazyvim_restore_max_exit_pre", { clear = true }), + desc = "Restore width/height when close Neovim while maximized", + callback = function() + M.maximize.set(false) + end, + }) + else + for _, opt in ipairs(M._maximized) do + vim.o[opt.k] = opt.v + end + M._maximized = nil + vim.cmd("wincmd =") end - M._maximized = nil - vim.cmd("wincmd =") - else - M._maximized = {} - local function set(k, v) - table.insert(M._maximized, 1, { k = k, v = vim.o[k] }) - vim.o[k] = v - end - set("winwidth", 999) - set("winheight", 999) - set("winminwidth", 10) - set("winminheight", 4) - vim.cmd("wincmd =") - end - -- `QuitPre` seems to be executed even if we quit a normal window, so we don't want that - -- `VimLeavePre` might be another consideration? Not sure about differences between the 2 - vim.api.nvim_create_autocmd("ExitPre", { - once = true, - group = vim.api.nvim_create_augroup("lazyvim_restore_max_exit_pre", { clear = true }), - desc = "Restore width/height when close Neovim while maximized", - callback = function() - M.maximize(false) - end, - }) -end + end, +} setmetatable(M, { __call = function(m, ...) From 9eefc6a3aaeb1a0742e676ba32c6963d649d3ca9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:49:29 +0200 Subject: [PATCH 07/71] chore(main): release 12.30.0 (#4036) :robot: I have created a release *beep* *boop* --- ## [12.30.0](https://github.com/LazyVim/LazyVim/compare/v12.29.2...v12.30.0) (2024-07-15) ### Features * **keymaps:** dynamic which-key icons/descriptions for toggles ([#4050](https://github.com/LazyVim/LazyVim/issues/4050)) ([78cf032](https://github.com/LazyVim/LazyVim/commit/78cf0320bfc34050883cde5e7af267184dc60ee9)) * **util.mini:** follow the user's mappings instead of hardcoded values ([#4043](https://github.com/LazyVim/LazyVim/issues/4043)) ([8506cb5](https://github.com/LazyVim/LazyVim/commit/8506cb5a98a528651a5557d8e447fa13bd8ac0cb)) ### Bug Fixes * **lsp:** lsp keymaps. Fixes [#4051](https://github.com/LazyVim/LazyVim/issues/4051) ([706ec4b](https://github.com/LazyVim/LazyVim/commit/706ec4b6b6be4265cbcfd326d3216f2a29952b55)) * **yanky:** enable yank history in visual mode ([#4048](https://github.com/LazyVim/LazyVim/issues/4048)) ([6911327](https://github.com/LazyVim/LazyVim/commit/6911327a5edca85ce3bc71229236494d9af7fafa)) ### Performance Improvements * **luasnip:** luasnip wasn't lazyloaded ([#4032](https://github.com/LazyVim/LazyVim/issues/4032)) ([e80ed32](https://github.com/LazyVim/LazyVim/commit/e80ed322a79a8b9857c6ab0ad76545654917ddcb)) --- 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 | 19 +++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 67008812..1abbe376 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.29.2" + ".": "12.30.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index b39b4a5e..f7f74112 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [12.30.0](https://github.com/LazyVim/LazyVim/compare/v12.29.2...v12.30.0) (2024-07-15) + + +### Features + +* **keymaps:** dynamic which-key icons/descriptions for toggles ([#4050](https://github.com/LazyVim/LazyVim/issues/4050)) ([78cf032](https://github.com/LazyVim/LazyVim/commit/78cf0320bfc34050883cde5e7af267184dc60ee9)) +* **util.mini:** follow the user's mappings instead of hardcoded values ([#4043](https://github.com/LazyVim/LazyVim/issues/4043)) ([8506cb5](https://github.com/LazyVim/LazyVim/commit/8506cb5a98a528651a5557d8e447fa13bd8ac0cb)) + + +### Bug Fixes + +* **lsp:** lsp keymaps. Fixes [#4051](https://github.com/LazyVim/LazyVim/issues/4051) ([706ec4b](https://github.com/LazyVim/LazyVim/commit/706ec4b6b6be4265cbcfd326d3216f2a29952b55)) +* **yanky:** enable yank history in visual mode ([#4048](https://github.com/LazyVim/LazyVim/issues/4048)) ([6911327](https://github.com/LazyVim/LazyVim/commit/6911327a5edca85ce3bc71229236494d9af7fafa)) + + +### Performance Improvements + +* **luasnip:** luasnip wasn't lazyloaded ([#4032](https://github.com/LazyVim/LazyVim/issues/4032)) ([e80ed32](https://github.com/LazyVim/LazyVim/commit/e80ed322a79a8b9857c6ab0ad76545654917ddcb)) + ## [12.29.2](https://github.com/LazyVim/LazyVim/compare/v12.29.1...v12.29.2) (2024-07-14) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 3616f826..08029fc9 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.29.2" -- x-release-please-version +M.version = "12.30.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From dc8a3a139e9986292e99b75e530fc3d9168fc001 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:09:19 +0200 Subject: [PATCH 08/71] chore(update): update repository (#4054) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .editorconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 18616d30..8b176d56 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,6 @@ root = true [*] -end_of_line = lf insert_final_newline = true indent_style = space indent_size = 2 From ab0135093bc18ccf82325bc8ee14c25230a71786 Mon Sep 17 00:00:00 2001 From: Stefan Boca <45266795+stefanboca@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:58:34 -0700 Subject: [PATCH 09/71] feat(treesitter-context): which-key toggle (#4059) ## Description Add a which-key toggle for treesitter-context ## Screenshots ![image](https://github.com/user-attachments/assets/28c02607-a7e8-409c-a190-4fd2db85e8bb) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- .../plugins/extras/ui/treesitter-context.lua | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-context.lua b/lua/lazyvim/plugins/extras/ui/treesitter-context.lua index a1f8d5f3..019977ed 100644 --- a/lua/lazyvim/plugins/extras/ui/treesitter-context.lua +++ b/lua/lazyvim/plugins/extras/ui/treesitter-context.lua @@ -1,21 +1,22 @@ -- 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" }) + event = "VeryLazy", + opts = function() + local tsc = require("treesitter-context") + + LazyVim.toggle.map("ut", { + name = "Treesitter Context", + get = tsc.enabled, + set = function(state) + if state then + tsc.enable() else - LazyVim.warn("Disabled Treesitter Context", { title = "Option" }) + tsc.disable() end end, - desc = "Toggle Treesitter Context", - }, - }, + }) + + return { mode = "cursor", max_lines = 3 } + end, } From a1335e59e15ef55ee43dd30120da948bc0f293c3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Jul 2024 23:56:05 +0200 Subject: [PATCH 10/71] style: fix toggle desc --- lua/lazyvim/util/toggle.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 99721e06..f7287a7b 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -20,7 +20,7 @@ function M.map(lhs, toggle) else LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) end - end, { desc = "Toggle" .. toggle.name }) + end, { desc = "Toggle " .. toggle.name }) M.wk(lhs, toggle) end From 5339acacec0996968d64fdbaf9fe8187bfea1b47 Mon Sep 17 00:00:00 2001 From: Ben Puryear <54869170+Ben10164@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:34:51 -0700 Subject: [PATCH 11/71] feat(R): added new which-key group for new install feature (#4078) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description A new feature was added to `r.nvim` that added a new key bind. This pr adds that key bind (and group in case more are added) to the current which-key config. (I also removed a comment that I made previously for increasing the width of the which-key window to fit the longer keybind descriptions, something that eventually was taken out of the previous PR long ago) ## Related Issue(s) None ## Screenshots Screenshot 2024-07-16 at 9 24 54 AM ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/r.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index 96e618b3..f2c46041 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -19,14 +19,15 @@ return { vim.keymap.set("n", "", "RDSendLine", { buffer = true }) vim.keymap.set("v", "", "RSendSelection", { buffer = true }) - -- Increase the width of which-key to handle the longer r-nvim descriptions local wk = require("which-key") wk.add({ + buffer = true, { "a", group = "all" }, { "b", group = "between marks" }, { "c", group = "chunks" }, { "f", group = "functions" }, { "g", group = "goto" }, + { "i", group = "install" }, { "k", group = "knit" }, { "p", group = "paragraph" }, { "q", group = "quarto" }, From 1ceac326528f436dff4cdee952912021cbc33cc6 Mon Sep 17 00:00:00 2001 From: folke Date: Tue, 16 Jul 2024 16:35:40 +0000 Subject: [PATCH 12/71] 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 30cdbd12..cd12fa6e 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 15 +*LazyVim.txt* For Neovim Last change: 2024 July 16 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 150523b77b6e848c4135a97a5fd8f6f79a6f4443 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 16 Jul 2024 23:34:27 +0200 Subject: [PATCH 13/71] 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 14/71] 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 15/71] 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 16/71] 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 17/71] 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 18/71] 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 19/71] 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 20/71] 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 21/71] 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 22/71] 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 23/71] 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 24/71] 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 25/71] 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 26/71] 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 27/71] 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 28/71] 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 29/71] 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 30/71] 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 From a219e105b0e86316edfedb57f1fa267a764eab13 Mon Sep 17 00:00:00 2001 From: Ben Puryear <54869170+Ben10164@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:33:49 -0700 Subject: [PATCH 31/71] feat(lang): add OCaml (#4079) ## Description Adds an extra that adds language support for ocaml. Adds LSP and completions. Fairly simple/small config. ## Related Issue(s) None ## Screenshots lsp ocaml ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/ocaml.lua | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/ocaml.lua diff --git a/lua/lazyvim/plugins/extras/lang/ocaml.lua b/lua/lazyvim/plugins/extras/lang/ocaml.lua new file mode 100644 index 00000000..d4485856 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/ocaml.lua @@ -0,0 +1,39 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "ml", "mli", "cmi", "cmo", "cmx", "cma", "cmxa", "cmxs", "cmt", "cmti", "opam" }, + root = { "merlin.opam", "dune-project" }, + }) + end, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "ocaml" }) + end + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + ocamllsp = { + get_language_id = function(_, ftype) + return language_id_of[ftype] + end, + root_dir = function(fname) + return require("lspconfig.util").root_pattern( + "*.opam", + "esy.json", + "package.json", + ".git", + "dune-project", + "dune-workspace", + "*.ml" + )(fname) + end, + }, + }, + }, + }, +} From 5795be3c195699719d135c45a96825b09719268b Mon Sep 17 00:00:00 2001 From: folke Date: Fri, 19 Jul 2024 07:34:55 +0000 Subject: [PATCH 32/71] 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 fcd74ffc..be7d61e6 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 18 +*LazyVim.txt* For Neovim Last change: 2024 July 19 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3e29fdf478383034c48477dd04fd433a7c9327ee Mon Sep 17 00:00:00 2001 From: Ben Puryear <54869170+Ben10164@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:38:55 -0700 Subject: [PATCH 33/71] feat(lang): add Lean 4 support (#4080) ## Description Adds language support for lean, a popular proof assistant and theorem prover. ## Related Issue(s) None ## Screenshots Language Server lsp Lean Execution (infobox on the right) goals Keymaps keymaps Many More Commands lots of commands ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/lean.lua | 125 +++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/lean.lua diff --git a/lua/lazyvim/plugins/extras/lang/lean.lua b/lua/lazyvim/plugins/extras/lang/lean.lua new file mode 100644 index 00000000..9ac37f7d --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/lean.lua @@ -0,0 +1,125 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "lean" }, + root = { "lean-toolchain" }, + }) + end, + "Julian/lean.nvim", + event = { "BufReadPre *.lean", "BufNewFile *.lean" }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + + -- see details below for full configuration options + opts = { + -- Enable the Lean language server(s)? + -- + -- false to disable, otherwise should be a table of options to pass to `leanls` + -- + -- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#leanls for details. + -- In particular ensure you have followed instructions setting up a callback + -- for `LspAttach` which sets your key bindings! + lsp = { + init_options = { + -- See Lean.Lsp.InitializationOptions for details and further options. + + -- Time (in milliseconds) which must pass since latest edit until elaboration begins. + -- Lower values may make editing feel faster at the cost of higher CPU usage. + -- Note that lean.nvim changes the Lean default for this value! + editDelay = 0, + + -- Whether to signal that widgets are supported. + hasWidgets = true, + }, + }, + + ft = { + -- A list of patterns which will be used to protect any matching + -- Lean file paths from being accidentally modified (by marking the + -- buffer as `nomodifiable`). + nomodifiable = { + -- by default, this list includes the Lean standard libraries, + -- as well as files within dependency directories (e.g. `_target`) + -- Set this to an empty table to disable. + }, + }, + + -- Abbreviation support + abbreviations = { + -- Enable expanding of unicode abbreviations? + enable = true, + -- additional abbreviations: + extra = { + -- Add a \wknight abbreviation to insert ♘ + -- + -- Note that the backslash is implied, and that you of + -- course may also use a snippet engine directly to do + -- this if so desired. + wknight = "♘", + }, + -- Change if you don't like the backslash + -- (comma is a popular choice on French keyboards) + leader = "\\", + }, + + -- Enable suggested mappings? + -- + -- false by default, true to enable + mappings = true, + + -- Infoview support + infoview = { + -- Automatically open an infoview on entering a Lean buffer? + -- Should be a function that will be called anytime a new Lean file + -- is opened. Return true to open an infoview, otherwise false. + -- Setting this to `true` is the same as `function() return true end`, + -- i.e. autoopen for any Lean file, or setting it to `false` is the + -- same as `function() return false end`, i.e. never autoopen. + autoopen = true, + + -- Set infoview windows' starting dimensions. + -- Windows are opened horizontally or vertically depending on spacing. + width = 50, + height = 20, + + -- Put the infoview on the top or bottom when horizontal? + -- top | bottom + horizontal_position = "bottom", + + -- Always open the infoview window in a separate tabpage. + -- Might be useful if you are using a screen reader and don't want too + -- many dynamic updates in the terminal at the same time. + -- Note that `height` and `width` will be ignored in this case. + separate_tab = false, + + -- Show indicators for pin locations when entering an infoview window? + -- always | never | auto (= only when there are multiple pins) + indicators = "auto", + }, + + -- Progress bar support + progress_bars = { + -- Enable the progress bars? + enable = true, + -- What character should be used for the bars? + character = "│", + -- Use a different priority for the signs + priority = 10, + }, + + -- Redirect Lean's stderr messages somehwere (to a buffer by default) + stderr = { + enable = true, + -- height of the window + height = 5, + -- a callback which will be called with (multi-line) stderr output + -- e.g., use: + -- on_lines = function(lines) vim.notify(lines) end + -- if you want to redirect stderr to `vim.notify`. + -- The default implementation will redirect to a dedicated stderr + -- window. + on_lines = nil, + }, + }, +} From 783949810855556dd12ed2685e62fb37a4c9504d Mon Sep 17 00:00:00 2001 From: Kevin Robayna Date: Fri, 19 Jul 2024 10:09:57 +0100 Subject: [PATCH 34/71] feat(extras): improve ruby extra by letting user chose (#3652) ## What is this PR for? Shopify started working on its own LSP (https://github.com/Shopify/ruby-lsp) and it performs way better than Solargraph which has a lot of limitations. This paired with sorbet gives better IntelliSense when navigating the code. This PR follows the same approach as Python and lets the user configure through vim.g options the lsp and formatter for ruby, without overriding any configuration. ## Does this PR fix an existing issue? One caveat though is that RubyLsp does not work very well with NeoVim < 0.10 https://github.com/Shopify/ruby-lsp/blob/main/EDITORS.md#neovim ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/ruby.lua | 43 +++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/ruby.lua b/lua/lazyvim/plugins/extras/lang/ruby.lua index c70e645d..6eb4fce5 100644 --- a/lua/lazyvim/plugins/extras/lang/ruby.lua +++ b/lua/lazyvim/plugins/extras/lang/ruby.lua @@ -1,3 +1,17 @@ +if lazyvim_docs then + -- LSP Server to use for Ruby. + -- Set to "solargraph" to use solargraph instead of ruby_lsp. + vim.g.lazyvim_ruby_lsp = "ruby_lsp" + vim.g.lazyvim_ruby_formatter = "rubocop" +end + +local lsp = vim.g.lazyvim_ruby_lsp or "ruby_lsp" +if vim.fn.has("nvim-0.10") == 0 then + -- ruby_lsp does not work well with Neovim < 0.10 + lsp = vim.g.lazyvim_ruby_lsp or "solargraph" +end +local formatter = vim.g.lazyvim_ruby_formatter or "rubocop" + return { recommended = function() return LazyVim.extras.wants({ @@ -11,12 +25,29 @@ return { }, { "neovim/nvim-lspconfig", + ---@class PluginLspOpts opts = { + ---@type lspconfig.options servers = { - solargraph = {}, + ruby_lsp = { + enabled = lsp == "ruby_lsp", + }, + solargraph = { + enabled = lsp == "solargraph", + }, + rubocop = { + enabled = formatter == "rubocop", + }, + standardrb = { + enabled = formatter == "standardrb", + }, }, }, }, + { + "williamboman/mason.nvim", + opts = { ensure_installed = { "erb-formatter", "erb-lint" } }, + }, { "mfussenegger/nvim-dap", optional = true, @@ -27,6 +58,16 @@ return { end, }, }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + ruby = { formatter }, + eruby = { "erb-format" }, + }, + }, + }, { "nvim-neotest/neotest", optional = true, From 64afb5f00718cb2735bd68577dfac357be790cb0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:50:05 +0200 Subject: [PATCH 35/71] chore(main): release 12.33.0 (#4102) :robot: I have created a release *beep* *boop* --- ## [12.33.0](https://github.com/LazyVim/LazyVim/compare/v12.32.0...v12.33.0) (2024-07-19) ### Features * **extras:** improve ruby extra by letting user chose ([#3652](https://github.com/LazyVim/LazyVim/issues/3652)) ([7839498](https://github.com/LazyVim/LazyVim/commit/783949810855556dd12ed2685e62fb37a4c9504d)) * **lang:** add Lean 4 support ([#4080](https://github.com/LazyVim/LazyVim/issues/4080)) ([3e29fdf](https://github.com/LazyVim/LazyVim/commit/3e29fdf478383034c48477dd04fd433a7c9327ee)) * **lang:** add OCaml ([#4079](https://github.com/LazyVim/LazyVim/issues/4079)) ([a219e10](https://github.com/LazyVim/LazyVim/commit/a219e105b0e86316edfedb57f1fa267a764eab13)) ### Bug Fixes * **ui:** trouble lualine component ([f9fdb35](https://github.com/LazyVim/LazyVim/commit/f9fdb356f2362e5ae4ef490944b1957b49dc6680)) --- 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 | 14 ++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 9f92a4d3..98ca8693 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.32.0" + ".": "12.33.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index b148a091..48c3581f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [12.33.0](https://github.com/LazyVim/LazyVim/compare/v12.32.0...v12.33.0) (2024-07-19) + + +### Features + +* **extras:** improve ruby extra by letting user chose ([#3652](https://github.com/LazyVim/LazyVim/issues/3652)) ([7839498](https://github.com/LazyVim/LazyVim/commit/783949810855556dd12ed2685e62fb37a4c9504d)) +* **lang:** add Lean 4 support ([#4080](https://github.com/LazyVim/LazyVim/issues/4080)) ([3e29fdf](https://github.com/LazyVim/LazyVim/commit/3e29fdf478383034c48477dd04fd433a7c9327ee)) +* **lang:** add OCaml ([#4079](https://github.com/LazyVim/LazyVim/issues/4079)) ([a219e10](https://github.com/LazyVim/LazyVim/commit/a219e105b0e86316edfedb57f1fa267a764eab13)) + + +### Bug Fixes + +* **ui:** trouble lualine component ([f9fdb35](https://github.com/LazyVim/LazyVim/commit/f9fdb356f2362e5ae4ef490944b1957b49dc6680)) + ## [12.32.0](https://github.com/LazyVim/LazyVim/compare/v12.31.0...v12.32.0) (2024-07-18) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index a95f519f..4d154371 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.32.0" -- x-release-please-version +M.version = "12.33.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 578f06e1401defbbc0a82f9ff1fb505564d038cf Mon Sep 17 00:00:00 2001 From: abeldekat <58370433+abeldekat@users.noreply.github.com> Date: Sat, 20 Jul 2024 11:48:11 +0200 Subject: [PATCH 36/71] perf(core): defer clipboard because xsel and pbcopy can be slow (#4120) ## Description See [this](https://github.com/LazyVim/LazyVim/discussions/4112) discussion TLDR: Startup time performance is affected quite significantly when the clipboard provider is `xsel`(linux) or `pbcopy`(macos). I expect an improvement in these cases, especially on older pc's. This PR resets `vim.opt.clipboard` after the `options` are loaded. Then, on `VeryLazy`, the setting is restored. I also tested with `yanky`. Relevant prints: 1. Before resetting `vim.opt.clipboard` in `init`, `vim.print(vim.opt.clipboard)` yields a table which will be captured: ```lua --- fields _name = "clipboard", _value = "unnamedplus", --- more fields ``` 2. Set `vim.opt.clipboard = ""` and `vim.print(vim.opt.clipboard)`, also yields a table: ```lua --- fields _name = "clipboard", _value = "", --- more fields ``` ## Related Issue(s) ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. Co-authored-by: abeldekat --- lua/lazyvim/config/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 4d154371..90051817 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -161,6 +161,7 @@ end ---@type LazyVimOptions local options +local lazy_clipboard ---@param opts? LazyVimOptions function M.setup(opts) @@ -181,6 +182,9 @@ function M.setup(opts) M.load("autocmds") end M.load("keymaps") + if lazy_clipboard ~= nil then + vim.opt.clipboard = lazy_clipboard + end LazyVim.format.setup() LazyVim.news.setup() @@ -285,6 +289,9 @@ function M.init() -- this is needed to make sure options will be correctly applied -- after installing missing plugins M.load("options") + -- defer built-in clipboard handling: "xsel" and "pbcopy" can be slow + lazy_clipboard = vim.opt.clipboard + vim.opt.clipboard = "" if vim.g.deprecation_warnings == false then vim.deprecate = function() end From 6f91b406ddf2b298efe43f6467ca0a9103881a88 Mon Sep 17 00:00:00 2001 From: folke Date: Sat, 20 Jul 2024 09:49:07 +0000 Subject: [PATCH 37/71] 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 be7d61e6..9a318334 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 19 +*LazyVim.txt* For Neovim Last change: 2024 July 20 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3d1f961232e0d286896e8c3026c9e2dbb3c63808 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jul 2024 17:04:01 +0200 Subject: [PATCH 38/71] refactor: which-key mappings --- lua/lazyvim/plugins/editor.lua | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 39108009..f893b355 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -169,13 +169,6 @@ return { { mode = { "n", "v" }, { "", group = "tabs" }, - { - "b", - group = "buffer", - expand = function() - return require("which-key.extras").expand.buf() - end, - }, { "c", group = "code" }, { "f", group = "file/find" }, { "g", group = "git" }, @@ -183,6 +176,19 @@ return { { "q", group = "quit/session" }, { "s", group = "search" }, { "u", group = "ui", icon = { icon = "󰙵 ", color = "cyan" } }, + { "x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } }, + { "[", group = "prev" }, + { "]", group = "next" }, + { "g", group = "goto" }, + { "gs", group = "surround" }, + { "z", group = "fold" }, + { + "b", + group = "buffer", + expand = function() + return require("which-key.extras").expand.buf() + end, + }, { "w", group = "windows", @@ -191,12 +197,8 @@ return { return require("which-key.extras").expand.win() end, }, - { "x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } }, - { "[", group = "prev" }, - { "]", group = "next" }, - { "g", group = "goto" }, - { "gs", group = "surround" }, - { "z", group = "fold" }, + -- better descriptions + { "gx", desc = "Open with system app" }, }, }, }, From eed91a3e4c1521dd839d1a8bc09bdd98ac2fb874 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jul 2024 17:14:07 +0200 Subject: [PATCH 39/71] fix(conform): changes for new conform.nvim config --- lua/lazyvim/plugins/formatting.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/formatting.lua b/lua/lazyvim/plugins/formatting.lua index f4160b4d..ae32c0ef 100644 --- a/lua/lazyvim/plugins/formatting.lua +++ b/lua/lazyvim/plugins/formatting.lua @@ -1,6 +1,6 @@ local M = {} ----@param opts ConformOpts +---@param opts conform.setupOpts function M.setup(_, opts) for _, key in ipairs({ "format_on_save", "format_after_save" }) do if opts[key] then @@ -10,6 +10,10 @@ function M.setup(_, opts) opts[key] = nil end end + ---@diagnostic disable-next-line: undefined-field + if opts.format then + LazyVim.warn("**conform.nvim** `opts.format` is deprecated. Please use `opts.default_format_opts` instead.") + end require("conform").setup(opts) end @@ -37,8 +41,7 @@ return { priority = 100, primary = true, format = function(buf) - local opts = LazyVim.opts("conform.nvim") - require("conform").format(LazyVim.merge({}, opts.format, { bufnr = buf })) + require("conform").format({ bufnr = buf }) end, sources = function(buf) local ret = require("conform").list_formatters(buf) @@ -59,16 +62,14 @@ return { "Please refer to the docs at https://www.lazyvim.org/plugins/formatting", }, { title = "LazyVim" }) end - ---@class ConformOpts + ---@type conform.setupOpts local opts = { - -- LazyVim will use these options when formatting with the conform.nvim formatter - format = { + default_format_opts = { timeout_ms = 3000, async = false, -- not recommended to change quiet = false, -- not recommended to change lsp_format = "fallback", -- not recommended to change }, - ---@type table formatters_by_ft = { lua = { "stylua" }, fish = { "fish_indent" }, From 0d561a3226b46f6a44c4f2c9be2288f3b52cc351 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jul 2024 21:39:39 +0200 Subject: [PATCH 40/71] feat(editor): replace nvim-spectre with grug-far.nvim (#4099) ## Description I'm considering to replace [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) with [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim). It has a better ui and I like the workflow better. I won't merge this right away. I'm mostly looking for feedback on whether this would be a good thing and whether the defaults option I've added seem ok. ## Related Issue(s) ## Screenshots ![image](https://github.com/user-attachments/assets/bc44e35b-e033-4769-ad40-cdfe9e3482f4) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- NEWS.md | 3 +++ lua/lazyvim/config/autocmds.lua | 1 + lua/lazyvim/plugins/editor.lua | 24 ++++++++++++++----- .../plugins/extras/ui/mini-animate.lua | 7 ++++++ 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/NEWS.md b/NEWS.md index 3abd43b7..1abf2ec8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,9 @@ ## 12.x +- [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) has been removed in favor of [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim). + **grug-far.nvim** has a great UI and feels more intuitive to use. + - This **news** is now also available on the website at [https://www.lazyvim.org/news](https://www.lazyvim.org/news) - **prettier** extra now works for all prettier supported filetypes diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 1440d069..edb392db 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -55,6 +55,7 @@ vim.api.nvim_create_autocmd("FileType", { group = augroup("close_with_q"), pattern = { "PlenaryTestPopup", + "grug-far", "help", "lspinfo", "notify", diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f893b355..1f96f8a2 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -128,13 +128,25 @@ return { -- search/replace in multiple files { - "nvim-pack/nvim-spectre", - build = false, - cmd = "Spectre", - opts = { open_cmd = "noswapfile vnew" }, - -- stylua: ignore + "MagicDuck/grug-far.nvim", + opts = { headerMaxWidth = 80 }, + cmd = "GrugFar", keys = { - { "sr", function() require("spectre").open() end, desc = "Replace in Files (Spectre)" }, + { + "sr", + function() + local is_visual = vim.fn.mode():lower():find("v") + if is_visual then -- needed to make visual selection work + vim.cmd([[normal! v]]) + end + local grug = require("grug-far"); + (is_visual and grug.with_visual_selection or grug.grug_far)({ + prefills = { filesFilter = "*." .. vim.fn.expand("%:e") }, + }) + end, + mode = { "n", "v" }, + desc = "Search and Replace", + }, }, }, diff --git a/lua/lazyvim/plugins/extras/ui/mini-animate.lua b/lua/lazyvim/plugins/extras/ui/mini-animate.lua index 571bee26..1136230a 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-animate.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-animate.lua @@ -14,6 +14,13 @@ return { end, { expr = true }) end + vim.api.nvim_create_autocmd("FileType", { + pattern = "grug-far", + callback = function() + vim.b.minianimate_disable = true + end, + }) + LazyVim.toggle.map("ua", { name = "Mini Animate", get = function() From c8ab5d7554da9f1eff69f5d6d8a0df38309d9f81 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jul 2024 22:06:16 +0200 Subject: [PATCH 41/71] fix(toggle): safe toggle get --- lua/lazyvim/util/toggle.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index c8027666..4e0ba494 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -39,14 +39,21 @@ function M.wk(lhs, toggle) if not LazyVim.has("which-key.nvim") then return end + local function safe_get() + local ok, enabled = pcall(toggle.get) + if not ok then + LazyVim.error({ "Failed to get toggle state for **" .. toggle.name .. "**:\n", enabled }, { once = true }) + end + return enabled + end require("which-key").add({ { lhs, icon = function() - return toggle.get() and { icon = " ", color = "green" } or { icon = " ", color = "yellow" } + return safe_get() and { icon = " ", color = "green" } or { icon = " ", color = "yellow" } end, desc = function() - return (toggle.get() and "Disable " or "Enable ") .. toggle.name + return (safe_get() and "Disable " or "Enable ") .. toggle.name end, }, }) From a997152eb2307380888d640440e0732493f82727 Mon Sep 17 00:00:00 2001 From: Shaun Clayton Date: Sat, 20 Jul 2024 16:14:33 -0400 Subject: [PATCH 42/71] feat(indent-blankline): add which-key toggles (#4122) ## Description Add which-key toggle mappings for toggling both the indention guides, and also scope highlight on a per buffer basis. ## Screenshots ![2024-07-20_08-16](https://github.com/user-attachments/assets/7b282868-c035-4f71-97dd-5738cd953713) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/ui.lua | 54 +++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index ed17182d..14807497 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -225,28 +225,40 @@ return { { "lukas-reineke/indent-blankline.nvim", event = "LazyFile", - opts = { - indent = { - char = "│", - tab_char = "│", - }, - scope = { show_start = false, show_end = false }, - exclude = { - filetypes = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", + opts = function() + LazyVim.toggle.map("ug", { + name = "Indention Guides", + get = function() + return require("ibl.config").get_config(0).enabled + end, + set = function(state) + require("ibl").setup_buffer(0, { enabled = state }) + end, + }) + + return { + indent = { + char = "│", + tab_char = "│", }, - }, - }, + scope = { show_start = false, show_end = false }, + exclude = { + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + }, + } + end, main = "ibl", }, From 43dbe0e60d0083f38ab5113a82d9c74229895af2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Jul 2024 22:27:04 +0200 Subject: [PATCH 43/71] chore(main): release 12.34.0 (#4121) :robot: I have created a release *beep* *boop* --- ## [12.34.0](https://github.com/LazyVim/LazyVim/compare/v12.33.0...v12.34.0) (2024-07-20) ### Features * **editor:** replace nvim-spectre with grug-far.nvim ([#4099](https://github.com/LazyVim/LazyVim/issues/4099)) ([0d561a3](https://github.com/LazyVim/LazyVim/commit/0d561a3226b46f6a44c4f2c9be2288f3b52cc351)) * **indent-blankline:** add which-key toggles ([#4122](https://github.com/LazyVim/LazyVim/issues/4122)) ([a997152](https://github.com/LazyVim/LazyVim/commit/a997152eb2307380888d640440e0732493f82727)) ### Bug Fixes * **conform:** changes for new conform.nvim config ([eed91a3](https://github.com/LazyVim/LazyVim/commit/eed91a3e4c1521dd839d1a8bc09bdd98ac2fb874)) * **toggle:** safe toggle get ([c8ab5d7](https://github.com/LazyVim/LazyVim/commit/c8ab5d7554da9f1eff69f5d6d8a0df38309d9f81)) ### Performance Improvements * **core:** defer clipboard because xsel and pbcopy can be slow ([#4120](https://github.com/LazyVim/LazyVim/issues/4120)) ([578f06e](https://github.com/LazyVim/LazyVim/commit/578f06e1401defbbc0a82f9ff1fb505564d038cf)) --- 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 | 19 +++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 98ca8693..67384c64 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.33.0" + ".": "12.34.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 48c3581f..09dbee59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [12.34.0](https://github.com/LazyVim/LazyVim/compare/v12.33.0...v12.34.0) (2024-07-20) + + +### Features + +* **editor:** replace nvim-spectre with grug-far.nvim ([#4099](https://github.com/LazyVim/LazyVim/issues/4099)) ([0d561a3](https://github.com/LazyVim/LazyVim/commit/0d561a3226b46f6a44c4f2c9be2288f3b52cc351)) +* **indent-blankline:** add which-key toggles ([#4122](https://github.com/LazyVim/LazyVim/issues/4122)) ([a997152](https://github.com/LazyVim/LazyVim/commit/a997152eb2307380888d640440e0732493f82727)) + + +### Bug Fixes + +* **conform:** changes for new conform.nvim config ([eed91a3](https://github.com/LazyVim/LazyVim/commit/eed91a3e4c1521dd839d1a8bc09bdd98ac2fb874)) +* **toggle:** safe toggle get ([c8ab5d7](https://github.com/LazyVim/LazyVim/commit/c8ab5d7554da9f1eff69f5d6d8a0df38309d9f81)) + + +### Performance Improvements + +* **core:** defer clipboard because xsel and pbcopy can be slow ([#4120](https://github.com/LazyVim/LazyVim/issues/4120)) ([578f06e](https://github.com/LazyVim/LazyVim/commit/578f06e1401defbbc0a82f9ff1fb505564d038cf)) + ## [12.33.0](https://github.com/LazyVim/LazyVim/compare/v12.32.0...v12.33.0) (2024-07-19) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 90051817..d6badcdf 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.33.0" -- x-release-please-version +M.version = "12.34.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 61ce1cfaaf8365e3b5c12b1509064579ab7d80b5 Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Sun, 21 Jul 2024 13:24:28 +0300 Subject: [PATCH 44/71] feat(python): default to new ruff instead of ruff_lsp (#4126) ## Description Change default python ruff lsp from `ruff_lsp` to `ruff`. It is now marked as stable. I have been using it for a few days without any problems. I use python for relatively small to medium projects. Maybe someone who is using python more rigorously has better feedback. References: https://github.com/astral-sh/ruff-lsp (see note) https://github.com/astral-sh/ruff/releases/tag/0.5.3 https://docs.astral.sh/ruff/editors/setup/#neovim Also the issue in https://github.com/LazyVim/LazyVim/pull/3057 has been resolved. I tested it and I only get 1 `ruff server` process per nvim instance. The processes close correctly when nvim is closed. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/python.lua | 43 ++++++++++++++-------- lua/lazyvim/plugins/lsp/init.lua | 3 ++ 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 399f28e3..a06b63d7 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -2,11 +2,12 @@ if lazyvim_docs then -- LSP Server to use for Python. -- Set to "basedpyright" to use basedpyright instead of pyright. vim.g.lazyvim_python_lsp = "pyright" - vim.g.lazyvim_python_ruff = "ruff_lsp" + -- Set to "ruff_lsp" to use the old LSP implementation version. + vim.g.lazyvim_python_ruff = "ruff" end local lsp = vim.g.lazyvim_python_lsp or "pyright" -local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp" +local ruff = vim.g.lazyvim_python_ruff or "ruff" return { recommended = function() @@ -30,22 +31,22 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - pyright = { - enabled = lsp == "pyright", - }, - basedpyright = { - enabled = lsp == "basedpyright", - }, - [lsp] = { - enabled = true, + ruff = { + cmd_env = { RUFF_TRACE = "messages" }, + init_options = { + settings = { + logLevel = "error", + }, + }, + keys = { + { + "co", + LazyVim.lsp.action["source.organizeImports"], + desc = "Organize Imports", + }, + }, }, ruff_lsp = { - enabled = ruff == "ruff_lsp", - }, - ruff = { - enabled = ruff == "ruff", - }, - [ruff] = { keys = { { "co", @@ -65,6 +66,16 @@ return { }, }, }, + { + "neovim/nvim-lspconfig", + opts = function(_, opts) + local servers = { "pyright", "basedpyright", "ruff", "ruff_lsp", ruff, lsp } + for _, server in ipairs(servers) do + opts.servers[server] = opts.servers[server] or {} + opts.servers[server].enabled = server == lsp or server == ruff + end + end, + }, { "nvim-neotest/neotest", optional = true, diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 0747547f..076344dd 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -196,6 +196,9 @@ return { local server_opts = vim.tbl_deep_extend("force", { capabilities = vim.deepcopy(capabilities), }, servers[server] or {}) + if server_opts.enabled == false then + return + end if opts.setup[server] then if opts.setup[server](server, server_opts) then From 76bc7b402223e011f2bfbd5bc2db98bf6d02262e Mon Sep 17 00:00:00 2001 From: folke Date: Sun, 21 Jul 2024 10:25:26 +0000 Subject: [PATCH 45/71] 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 9a318334..92935de3 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 20 +*LazyVim.txt* For Neovim Last change: 2024 July 21 ============================================================================== Table of Contents *LazyVim-table-of-contents* From fca038b433a07e36f063a60804f3eae7a0f268ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Jul 2024 15:53:07 +0200 Subject: [PATCH 46/71] chore(main): release 12.35.0 (#4128) :robot: I have created a release *beep* *boop* --- ## [12.35.0](https://github.com/LazyVim/LazyVim/compare/v12.34.0...v12.35.0) (2024-07-21) ### Features * **python:** default to new ruff instead of ruff_lsp ([#4126](https://github.com/LazyVim/LazyVim/issues/4126)) ([61ce1cf](https://github.com/LazyVim/LazyVim/commit/61ce1cfaaf8365e3b5c12b1509064579ab7d80b5)) --- 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 | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 67384c64..50859833 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.34.0" + ".": "12.35.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 09dbee59..c0081c2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.35.0](https://github.com/LazyVim/LazyVim/compare/v12.34.0...v12.35.0) (2024-07-21) + + +### Features + +* **python:** default to new ruff instead of ruff_lsp ([#4126](https://github.com/LazyVim/LazyVim/issues/4126)) ([61ce1cf](https://github.com/LazyVim/LazyVim/commit/61ce1cfaaf8365e3b5c12b1509064579ab7d80b5)) + ## [12.34.0](https://github.com/LazyVim/LazyVim/compare/v12.33.0...v12.34.0) (2024-07-20) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index d6badcdf..6f2477b2 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.34.0" -- x-release-please-version +M.version = "12.35.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 6411ab0897f19dad9f902dfee29e101a9a767357 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 21 Jul 2024 17:20:29 +0200 Subject: [PATCH 47/71] fix(grug-far): only prefill files filter when file has an extension. Closes #4130 --- lua/lazyvim/plugins/editor.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 1f96f8a2..2e6444a1 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -139,9 +139,11 @@ return { if is_visual then -- needed to make visual selection work vim.cmd([[normal! v]]) end - local grug = require("grug-far"); + local grug = require("grug-far") + local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") + local filesFilter = ext and ext ~= "" and "*." .. ext or nil; (is_visual and grug.with_visual_selection or grug.grug_far)({ - prefills = { filesFilter = "*." .. vim.fn.expand("%:e") }, + prefills = { filesFilter = filesFilter }, }) end, mode = { "n", "v" }, From 8db2f3af39454ab51422a83cfc6632d013660691 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Jul 2024 17:34:32 +0200 Subject: [PATCH 48/71] chore(main): release 12.35.1 (#4131) :robot: I have created a release *beep* *boop* --- ## [12.35.1](https://github.com/LazyVim/LazyVim/compare/v12.35.0...v12.35.1) (2024-07-21) ### Bug Fixes * **grug-far:** only prefill files filter when file has an extension. Closes [#4130](https://github.com/LazyVim/LazyVim/issues/4130) ([6411ab0](https://github.com/LazyVim/LazyVim/commit/6411ab0897f19dad9f902dfee29e101a9a767357)) --- 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 | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 50859833..5f2f4b51 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.35.0" + ".": "12.35.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index c0081c2e..855e16ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.35.1](https://github.com/LazyVim/LazyVim/compare/v12.35.0...v12.35.1) (2024-07-21) + + +### Bug Fixes + +* **grug-far:** only prefill files filter when file has an extension. Closes [#4130](https://github.com/LazyVim/LazyVim/issues/4130) ([6411ab0](https://github.com/LazyVim/LazyVim/commit/6411ab0897f19dad9f902dfee29e101a9a767357)) + ## [12.35.0](https://github.com/LazyVim/LazyVim/compare/v12.34.0...v12.35.0) (2024-07-21) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 6f2477b2..eefdd035 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.35.0" -- x-release-please-version +M.version = "12.35.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 72d0cad3530d877401ad9674f5266c79fbec396b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Jul 2024 08:38:32 +0200 Subject: [PATCH 49/71] feat(grug-far): no longer needed to call visual replace separately --- lua/lazyvim/plugins/editor.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 2e6444a1..28808394 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -135,15 +135,12 @@ return { { "sr", function() - local is_visual = vim.fn.mode():lower():find("v") - if is_visual then -- needed to make visual selection work - vim.cmd([[normal! v]]) - end local grug = require("grug-far") local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") - local filesFilter = ext and ext ~= "" and "*." .. ext or nil; - (is_visual and grug.with_visual_selection or grug.grug_far)({ - prefills = { filesFilter = filesFilter }, + grug.grug_far({ + prefills = { + filesFilter = ext and ext ~= "" and "*." .. ext or nil, + }, }) end, mode = { "n", "v" }, From 3a87ce4afb3a780be14fe3efcd7924570285538c Mon Sep 17 00:00:00 2001 From: folke Date: Mon, 22 Jul 2024 06:39:25 +0000 Subject: [PATCH 50/71] 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 92935de3..a0b980b7 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 21 +*LazyVim.txt* For Neovim Last change: 2024 July 22 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 5626d98d1c6c4713de3a0629050e0a39daa3fba8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Jul 2024 14:24:32 +0200 Subject: [PATCH 51/71] ci: update --- .github/workflows/stale.yml | 3 ++- .github/workflows/update.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index a0c704be..4e0273bc 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -5,6 +5,7 @@ on: - cron: "30 1 * * *" jobs: - ci: + stale: + if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner) uses: folke/github/.github/workflows/stale.yml@main secrets: inherit diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 2177a50b..6784ef9c 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -7,6 +7,7 @@ on: - cron: "0 * * * *" jobs: - ci: + update: + if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner) uses: folke/github/.github/workflows/update.yml@main secrets: inherit From 03968eb3f08036d8b7415712caff7e48b63b8ece Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:25:04 +0200 Subject: [PATCH 52/71] chore(main): release 12.36.0 (#4135) :robot: I have created a release *beep* *boop* --- ## [12.36.0](https://github.com/LazyVim/LazyVim/compare/v12.35.1...v12.36.0) (2024-07-22) ### Features * **grug-far:** no longer needed to call visual replace separately ([72d0cad](https://github.com/LazyVim/LazyVim/commit/72d0cad3530d877401ad9674f5266c79fbec396b)) --- 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 | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 5f2f4b51..8560146d 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.35.1" + ".": "12.36.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 855e16ba..33cbefe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.36.0](https://github.com/LazyVim/LazyVim/compare/v12.35.1...v12.36.0) (2024-07-22) + + +### Features + +* **grug-far:** no longer needed to call visual replace separately ([72d0cad](https://github.com/LazyVim/LazyVim/commit/72d0cad3530d877401ad9674f5266c79fbec396b)) + ## [12.35.1](https://github.com/LazyVim/LazyVim/compare/v12.35.0...v12.35.1) (2024-07-21) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index eefdd035..e8d943f3 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.35.1" -- x-release-please-version +M.version = "12.36.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 1c2be200c185a4567c6a634da2b624d9a638fe73 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Jul 2024 23:26:03 +0200 Subject: [PATCH 53/71] fix(grug-far): use new transient option --- lua/lazyvim/config/autocmds.lua | 1 - lua/lazyvim/plugins/editor.lua | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index edb392db..1440d069 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -55,7 +55,6 @@ vim.api.nvim_create_autocmd("FileType", { group = augroup("close_with_q"), pattern = { "PlenaryTestPopup", - "grug-far", "help", "lspinfo", "notify", diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 28808394..18ded3ae 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -138,6 +138,7 @@ return { local grug = require("grug-far") local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") grug.grug_far({ + transient = true, prefills = { filesFilter = ext and ext ~= "" and "*." .. ext or nil, }, From f94a0591b3e5838794b1c3897ec21491aeb080fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Mon, 22 Jul 2024 15:11:30 -0700 Subject: [PATCH 54/71] feat(elixir): add elixirls code actions (#4148) This is a refactoring of #3846 with the changes: - Use `Lazyvim.lsp.execute` on keymaps to make everything simpler; - Remove expandMacro. Closes #3846 --------- Co-authored-by: Ahmed Kamal --- lua/lazyvim/plugins/extras/lang/elixir.lua | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/elixir.lua b/lua/lazyvim/plugins/extras/lang/elixir.lua index d82e988e..f391edbd 100644 --- a/lua/lazyvim/plugins/extras/lang/elixir.lua +++ b/lua/lazyvim/plugins/extras/lang/elixir.lua @@ -9,7 +9,32 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - elixirls = {}, + elixirls = { + keys = { + { + "cp", + function() + local params = vim.lsp.util.make_position_params() + LazyVim.lsp.execute({ + command = "manipulatePipes:serverid", + arguments = { "toPipe", params.textDocument.uri, params.position.line, params.position.character }, + }) + end, + desc = "To Pipe", + }, + { + "cP", + function() + local params = vim.lsp.util.make_position_params() + LazyVim.lsp.execute({ + command = "manipulatePipes:serverid", + arguments = { "fromPipe", params.textDocument.uri, params.position.line, params.position.character }, + }) + end, + desc = "From Pipe", + }, + }, + }, }, }, }, From f6cd4a38c667e3ef56672d723705ecd8a774a0f4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 23 Jul 2024 06:55:34 +0200 Subject: [PATCH 55/71] fix(news): deprecated API --- lua/lazyvim/util/news.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/news.lua b/lua/lazyvim/util/news.lua index d1a6b44b..69f79256 100644 --- a/lua/lazyvim/util/news.lua +++ b/lua/lazyvim/util/news.lua @@ -81,7 +81,11 @@ function M.open(file, opts) vim.opt_local.signcolumn = "yes" vim.opt_local.statuscolumn = " " vim.opt_local.conceallevel = 3 - vim.diagnostic.disable(float.buf) + if vim.diagnostic.enable then + vim.diagnostic.enable(false, { bufnr = float.buf }) + else + vim.diagnostic.disable(float.buf) + end end return M From 5727da6ff72f6c0b625540a74b3d5877c0aba04e Mon Sep 17 00:00:00 2001 From: folke Date: Tue, 23 Jul 2024 05:18:13 +0000 Subject: [PATCH 56/71] 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 a0b980b7..3873f299 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 22 +*LazyVim.txt* For Neovim Last change: 2024 July 23 ============================================================================== Table of Contents *LazyVim-table-of-contents* From f0d8b8b293c1fc798b576a74a87f9bd0b59714f3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 23 Jul 2024 08:29:07 +0200 Subject: [PATCH 57/71] fix(keymaps): leader-wd --- lua/lazyvim/config/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 6468864b..9a0037b1 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -177,7 +177,7 @@ map("t", "", "close", { desc = "which_key_ignore" }) 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 }) -map("n", "d", "c", { desc = "Delete Window", remap = true }) +map("n", "wd", "c", { desc = "Delete Window", remap = true }) LazyVim.toggle.map("m", LazyVim.toggle.maximize) -- tabs From caf227dd08e83c826800cb88c34c87c600793fa3 Mon Sep 17 00:00:00 2001 From: Miguel Palau Date: Tue, 23 Jul 2024 09:05:18 -0600 Subject: [PATCH 58/71] fix(dap): extend dap.configurations from .vscode/launch.json (#4106) ## Description This PR allows the nvim-dap module to read from vscode's launch.json and add those configurations to the ones in nvim-dap. ## Related Issue(s) ## Screenshots Before: image After: image ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Micah Halter --- lua/lazyvim/plugins/extras/dap/core.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index ac6709f1..67a3d71b 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -69,6 +69,11 @@ return { vscode.json_decode = function(str) return vim.json.decode(json.json_strip_comments(str)) end + + -- Extends dap.configurations with entries read from .vscode/launch.json + if vim.fn.filereadable(".vscode/launch.json") then + vscode.load_launchjs() + end end, }, From 940d7df59aac01f6cc587f035d9b4913139fae60 Mon Sep 17 00:00:00 2001 From: moetayuko Date: Wed, 24 Jul 2024 03:27:29 +0800 Subject: [PATCH 59/71] fix(dap): don't mess up DAP adapters provided by nvim-dap-python (#4141) ## Description * mason-nvim-dap.nvim ships a `Python: Launch file` adapter which does the same thing as `Launch file` of nvim-dap-python, providing both doesn't make sense and confuses the users. * mason-nvim-dap.nvim unexpectedly overrides nvim-dap-python's adapters and breaks its venv detection. As a result, user programs are always executed in mason debugpy venv rather than the activated one. ## Related Issue(s) Fixes #3064 ## Screenshots ## Checklist - [X] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/python.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index a06b63d7..f85b23be 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -138,4 +138,15 @@ return { table.insert(opts.auto_brackets, "python") end, }, + + -- Don't mess up DAP adapters provided by nvim-dap-python + { + "jay-babu/mason-nvim-dap.nvim", + optional = true, + opts = { + handlers = { + python = function() end, + }, + }, + }, } From 4bf6d856a805d38c19c8485c7a062d6cbc5cfaa8 Mon Sep 17 00:00:00 2001 From: EJ <8498296+maddawik@users.noreply.github.com> Date: Wed, 24 Jul 2024 00:26:27 -0400 Subject: [PATCH 60/71] feat(catppuccin): enable grug-far integration (#4156) ## Description This enables the recently added `grug-far` integration in catppuccin - https://github.com/catppuccin/nvim/pull/735 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/colorscheme.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/colorscheme.lua b/lua/lazyvim/plugins/colorscheme.lua index bb63326e..c6376e1b 100644 --- a/lua/lazyvim/plugins/colorscheme.lua +++ b/lua/lazyvim/plugins/colorscheme.lua @@ -19,6 +19,7 @@ return { cmp = true, dashboard = true, flash = true, + grug_far = true, gitsigns = true, headlines = true, illuminate = true, From ec8de342d7057be3da4a838faa565b66b2db6359 Mon Sep 17 00:00:00 2001 From: folke Date: Wed, 24 Jul 2024 04:27:22 +0000 Subject: [PATCH 61/71] 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 3873f299..682741ae 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 23 +*LazyVim.txt* For Neovim Last change: 2024 July 24 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 391f506295607e12db545b85fcbe0e00b1b8efa9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 24 Jul 2024 07:03:44 +0200 Subject: [PATCH 62/71] fix(keymaps): leader-wm --- lua/lazyvim/config/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 9a0037b1..a6f1c574 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -178,7 +178,7 @@ 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 }) map("n", "wd", "c", { desc = "Delete Window", remap = true }) -LazyVim.toggle.map("m", LazyVim.toggle.maximize) +LazyVim.toggle.map("wm", LazyVim.toggle.maximize) -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) From 489a7a8e844e1757950d24828a2919f385ab73f4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 07:05:03 +0200 Subject: [PATCH 63/71] chore(main): release 12.37.0 (#4147) :robot: I have created a release *beep* *boop* --- ## [12.37.0](https://github.com/LazyVim/LazyVim/compare/v12.36.0...v12.37.0) (2024-07-24) ### Features * **catppuccin:** enable grug-far integration ([#4156](https://github.com/LazyVim/LazyVim/issues/4156)) ([4bf6d85](https://github.com/LazyVim/LazyVim/commit/4bf6d856a805d38c19c8485c7a062d6cbc5cfaa8)) * **elixir:** add elixirls code actions ([#4148](https://github.com/LazyVim/LazyVim/issues/4148)) ([f94a059](https://github.com/LazyVim/LazyVim/commit/f94a0591b3e5838794b1c3897ec21491aeb080fe)) ### Bug Fixes * **dap:** don't mess up DAP adapters provided by nvim-dap-python ([#4141](https://github.com/LazyVim/LazyVim/issues/4141)) ([940d7df](https://github.com/LazyVim/LazyVim/commit/940d7df59aac01f6cc587f035d9b4913139fae60)) * **dap:** extend dap.configurations from .vscode/launch.json ([#4106](https://github.com/LazyVim/LazyVim/issues/4106)) ([caf227d](https://github.com/LazyVim/LazyVim/commit/caf227dd08e83c826800cb88c34c87c600793fa3)) * **grug-far:** use new transient option ([1c2be20](https://github.com/LazyVim/LazyVim/commit/1c2be200c185a4567c6a634da2b624d9a638fe73)) * **keymaps:** leader-wd ([f0d8b8b](https://github.com/LazyVim/LazyVim/commit/f0d8b8b293c1fc798b576a74a87f9bd0b59714f3)) * **keymaps:** leader-wm ([391f506](https://github.com/LazyVim/LazyVim/commit/391f506295607e12db545b85fcbe0e00b1b8efa9)) * **news:** deprecated API ([f6cd4a3](https://github.com/LazyVim/LazyVim/commit/f6cd4a38c667e3ef56672d723705ecd8a774a0f4)) --- 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 | 18 ++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 8560146d..6521921c 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.36.0" + ".": "12.37.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 33cbefe9..491d2502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [12.37.0](https://github.com/LazyVim/LazyVim/compare/v12.36.0...v12.37.0) (2024-07-24) + + +### Features + +* **catppuccin:** enable grug-far integration ([#4156](https://github.com/LazyVim/LazyVim/issues/4156)) ([4bf6d85](https://github.com/LazyVim/LazyVim/commit/4bf6d856a805d38c19c8485c7a062d6cbc5cfaa8)) +* **elixir:** add elixirls code actions ([#4148](https://github.com/LazyVim/LazyVim/issues/4148)) ([f94a059](https://github.com/LazyVim/LazyVim/commit/f94a0591b3e5838794b1c3897ec21491aeb080fe)) + + +### Bug Fixes + +* **dap:** don't mess up DAP adapters provided by nvim-dap-python ([#4141](https://github.com/LazyVim/LazyVim/issues/4141)) ([940d7df](https://github.com/LazyVim/LazyVim/commit/940d7df59aac01f6cc587f035d9b4913139fae60)) +* **dap:** extend dap.configurations from .vscode/launch.json ([#4106](https://github.com/LazyVim/LazyVim/issues/4106)) ([caf227d](https://github.com/LazyVim/LazyVim/commit/caf227dd08e83c826800cb88c34c87c600793fa3)) +* **grug-far:** use new transient option ([1c2be20](https://github.com/LazyVim/LazyVim/commit/1c2be200c185a4567c6a634da2b624d9a638fe73)) +* **keymaps:** leader-wd ([f0d8b8b](https://github.com/LazyVim/LazyVim/commit/f0d8b8b293c1fc798b576a74a87f9bd0b59714f3)) +* **keymaps:** leader-wm ([391f506](https://github.com/LazyVim/LazyVim/commit/391f506295607e12db545b85fcbe0e00b1b8efa9)) +* **news:** deprecated API ([f6cd4a3](https://github.com/LazyVim/LazyVim/commit/f6cd4a38c667e3ef56672d723705ecd8a774a0f4)) + ## [12.36.0](https://github.com/LazyVim/LazyVim/compare/v12.35.1...v12.36.0) (2024-07-22) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index e8d943f3..5efeb422 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.36.0" -- x-release-please-version +M.version = "12.37.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 264abdf9d52fe44c1dcb66f0502dcba5a881ea43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Tue, 23 Jul 2024 23:02:56 -0700 Subject: [PATCH 64/71] feat(markdown): replace `headlines.nvim` by `markdown.nvim` (#4139) Okay, so https://github.com/MeanderingProgrammer/markdown.nvim?tab=readme-ov-file is a new kid on the block that I've been enjoying a lot. It replaces headlines.nvim. This new extra is a way for folks to try markdown.nvim effortlessly. (Should I add here everything from the current markdown extra to make this extra a complete drop-in replacement?) --------- Co-authored-by: Folke Lemaitre --- NEWS.md | 3 ++ lua/lazyvim/plugins/extras/lang/markdown.lua | 39 +++++++------------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/NEWS.md b/NEWS.md index 1abf2ec8..20b6156b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,9 @@ ## 12.x +- **Markdown Extra**: [headlines.nvim](https://github.com/lukas-reineke/headlines.nvim) has been removed in favor of [markdown.nvim](https://github.com/MeanderingProgrammer/markdown.nvim) + to spice up your markdown files. + - [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) has been removed in favor of [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim). **grug-far.nvim** has a great UI and feels more intuitive to use. diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 7d026b23..2257d73e 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -92,31 +92,20 @@ return { }, { - "lukas-reineke/headlines.nvim", - opts = function() - local opts = {} - for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do - opts[ft] = { - headline_highlights = {}, - -- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66 - bullets = {}, - quote_string = false, - } - for i = 1, 6 do - local hl = "Headline" .. i - vim.api.nvim_set_hl(0, hl, { link = "Headline", default = true }) - table.insert(opts[ft].headline_highlights, hl) - end - end - return opts - end, + "MeanderingProgrammer/markdown.nvim", + opts = { + file_types = { "markdown", "norg", "rmd", "org" }, + code = { + sign = false, + width = "block", + right_pad = 1, + }, + heading = { + sign = false, + icons = {}, + }, + }, ft = { "markdown", "norg", "rmd", "org" }, - config = function(_, opts) - -- PERF: schedule to prevent headlines slowing down opening a file - vim.schedule(function() - require("headlines").setup(opts) - require("headlines").refresh() - end) - end, + enabled = true, }, } From c8d0faf9b152283b2ae74f9594287a834eae002a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 24 Jul 2024 08:21:36 +0200 Subject: [PATCH 65/71] feat(markdown): markdown-render toggle --- lua/lazyvim/plugins/extras/lang/markdown.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 2257d73e..0934f10a 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -106,6 +106,22 @@ return { }, }, ft = { "markdown", "norg", "rmd", "org" }, - enabled = true, + config = function(_, opts) + require("render-markdown").setup(opts) + LazyVim.toggle.map("um", { + name = "Render Markdown", + get = function() + return require("render-markdown.state").enabled + end, + set = function(enabled) + local m = require("render-markdown") + if enabled then + m.enable() + else + m.disable() + end + end, + }) + end, }, } From 71b26905822e81ec4a3842947d32a1b46c185948 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:30:15 +0200 Subject: [PATCH 66/71] chore(main): release 12.38.0 (#4158) :robot: I have created a release *beep* *boop* --- ## [12.38.0](https://github.com/LazyVim/LazyVim/compare/v12.37.0...v12.38.0) (2024-07-24) ### Features * **markdown:** markdown-render toggle ([c8d0faf](https://github.com/LazyVim/LazyVim/commit/c8d0faf9b152283b2ae74f9594287a834eae002a)) * **markdown:** replace `headlines.nvim` by `markdown.nvim` ([#4139](https://github.com/LazyVim/LazyVim/issues/4139)) ([264abdf](https://github.com/LazyVim/LazyVim/commit/264abdf9d52fe44c1dcb66f0502dcba5a881ea43)) --- 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 | 8 ++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 6521921c..246eb3cd 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.37.0" + ".": "12.38.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 491d2502..58c2a2ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [12.38.0](https://github.com/LazyVim/LazyVim/compare/v12.37.0...v12.38.0) (2024-07-24) + + +### Features + +* **markdown:** markdown-render toggle ([c8d0faf](https://github.com/LazyVim/LazyVim/commit/c8d0faf9b152283b2ae74f9594287a834eae002a)) +* **markdown:** replace `headlines.nvim` by `markdown.nvim` ([#4139](https://github.com/LazyVim/LazyVim/issues/4139)) ([264abdf](https://github.com/LazyVim/LazyVim/commit/264abdf9d52fe44c1dcb66f0502dcba5a881ea43)) + ## [12.37.0](https://github.com/LazyVim/LazyVim/compare/v12.36.0...v12.37.0) (2024-07-24) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 5efeb422..5b293612 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.37.0" -- x-release-please-version +M.version = "12.38.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 328272144c8c0b2d96988770d48c690a72613a81 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 24 Jul 2024 18:17:58 +0200 Subject: [PATCH 67/71] fix(autcmds): added grug-far to close with q --- lua/lazyvim/config/autocmds.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 1440d069..edb392db 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -55,6 +55,7 @@ vim.api.nvim_create_autocmd("FileType", { group = augroup("close_with_q"), pattern = { "PlenaryTestPopup", + "grug-far", "help", "lspinfo", "notify", From bcbab77f0c5851e6d73f275f2d27c3baa4f6aa68 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:49:45 +0200 Subject: [PATCH 68/71] chore(main): release 12.38.1 (#4167) :robot: I have created a release *beep* *boop* --- ## [12.38.1](https://github.com/LazyVim/LazyVim/compare/v12.38.0...v12.38.1) (2024-07-24) ### Bug Fixes * **autcmds:** added grug-far to close with q ([3282721](https://github.com/LazyVim/LazyVim/commit/328272144c8c0b2d96988770d48c690a72613a81)) --- 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 | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 246eb3cd..5311a37b 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.38.0" + ".": "12.38.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c2a2ce..c99bc273 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.38.1](https://github.com/LazyVim/LazyVim/compare/v12.38.0...v12.38.1) (2024-07-24) + + +### Bug Fixes + +* **autcmds:** added grug-far to close with q ([3282721](https://github.com/LazyVim/LazyVim/commit/328272144c8c0b2d96988770d48c690a72613a81)) + ## [12.38.0](https://github.com/LazyVim/LazyVim/compare/v12.37.0...v12.38.0) (2024-07-24) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 5b293612..406ef85c 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.38.0" -- x-release-please-version +M.version = "12.38.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 94bf4f932482012306fb375c4418a398bb00a949 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 25 Jul 2024 10:55:06 +0200 Subject: [PATCH 69/71] fix(news): pcall diag when showing news for older Neovim versions --- lua/lazyvim/util/news.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/news.lua b/lua/lazyvim/util/news.lua index 69f79256..5fb4a08c 100644 --- a/lua/lazyvim/util/news.lua +++ b/lua/lazyvim/util/news.lua @@ -82,9 +82,9 @@ function M.open(file, opts) vim.opt_local.statuscolumn = " " vim.opt_local.conceallevel = 3 if vim.diagnostic.enable then - vim.diagnostic.enable(false, { bufnr = float.buf }) + pcall(vim.diagnostic.enable, false, { bufnr = float.buf }) else - vim.diagnostic.disable(float.buf) + pcall(vim.diagnostic.disable, float.buf) end end From deceafc0f9159fa194804ec0c4f26ba08f4ec838 Mon Sep 17 00:00:00 2001 From: folke Date: Thu, 25 Jul 2024 08:56:05 +0000 Subject: [PATCH 70/71] 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 682741ae..70d3657a 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 24 +*LazyVim.txt* For Neovim Last change: 2024 July 25 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 12818a6cb499456f4903c5d8e68af43753ebc869 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 11:07:00 +0200 Subject: [PATCH 71/71] chore(main): release 12.38.2 (#4178) :robot: I have created a release *beep* *boop* --- ## [12.38.2](https://github.com/LazyVim/LazyVim/compare/v12.38.1...v12.38.2) (2024-07-25) ### Bug Fixes * **news:** pcall diag when showing news for older Neovim versions ([94bf4f9](https://github.com/LazyVim/LazyVim/commit/94bf4f932482012306fb375c4418a398bb00a949)) --- 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 | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 5311a37b..b9d0dcaf 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.38.1" + ".": "12.38.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index c99bc273..9c626d98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.38.2](https://github.com/LazyVim/LazyVim/compare/v12.38.1...v12.38.2) (2024-07-25) + + +### Bug Fixes + +* **news:** pcall diag when showing news for older Neovim versions ([94bf4f9](https://github.com/LazyVim/LazyVim/commit/94bf4f932482012306fb375c4418a398bb00a949)) + ## [12.38.1](https://github.com/LazyVim/LazyVim/compare/v12.38.0...v12.38.1) (2024-07-24) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 406ef85c..f6978842 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.38.1" -- x-release-please-version +M.version = "12.38.2" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions