From d1529f650fdd89cb620258bdeca5ed7b558420c7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:58:56 +0100 Subject: [PATCH 01/78] chore(main): release 14.6.1 (#5320) :robot: I have created a release *beep* *boop* --- ## [14.6.1](https://github.com/LazyVim/LazyVim/compare/v14.6.0...v14.6.1) (2025-01-08) ### Bug Fixes * **blink:** added new luasnip preset ([8d2d9a9](https://github.com/LazyVim/LazyVim/commit/8d2d9a9bd965aab0a752f24ec327d2f391a8406b)) * **luasnip:** correctly remove duplicate snippets ([#5214](https://github.com/LazyVim/LazyVim/issues/5214)) ([05c3447](https://github.com/LazyVim/LazyVim/commit/05c3447558fa6eef7ae3c0d3e7ed1c281572274d)) * **nlua:** debugger not responding ([#5319](https://github.com/LazyVim/LazyVim/issues/5319)) ([4e746d0](https://github.com/LazyVim/LazyVim/commit/4e746d0e5625662e1f121b39f63836b653ed728b)) --- 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 | 9 +++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index a1d48029..114400ff 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "14.6.0" + ".": "14.6.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 429db78c..2ea4a272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [14.6.1](https://github.com/LazyVim/LazyVim/compare/v14.6.0...v14.6.1) (2025-01-08) + + +### Bug Fixes + +* **blink:** added new luasnip preset ([8d2d9a9](https://github.com/LazyVim/LazyVim/commit/8d2d9a9bd965aab0a752f24ec327d2f391a8406b)) +* **luasnip:** correctly remove duplicate snippets ([#5214](https://github.com/LazyVim/LazyVim/issues/5214)) ([05c3447](https://github.com/LazyVim/LazyVim/commit/05c3447558fa6eef7ae3c0d3e7ed1c281572274d)) +* **nlua:** debugger not responding ([#5319](https://github.com/LazyVim/LazyVim/issues/5319)) ([4e746d0](https://github.com/LazyVim/LazyVim/commit/4e746d0e5625662e1f121b39f63836b653ed728b)) + ## [14.6.0](https://github.com/LazyVim/LazyVim/compare/v14.5.0...v14.6.0) (2024-12-20) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 606ed797..fbe6b74c 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 = "14.6.0" -- x-release-please-version +M.version = "14.6.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 13044c298ed1837a2d938b64710528d359dc8407 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 14 Jan 2025 22:54:12 +0100 Subject: [PATCH 02/78] feat(extras): added extra for snacks picker (#5368) ## Description See https://github.com/folke/snacks.nvim/pull/445 NOTE: I'm **not** going to replace `fzf-lua` anytime soon. Learned my lessons with that one :) ## Related Issue(s) ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/config/keymaps.lua | 8 +- lua/lazyvim/plugins/editor.lua | 6 + lua/lazyvim/plugins/extras/editor/fzf.lua | 3 + .../plugins/extras/editor/snacks_picker.lua | 127 ++++++++++++++++++ lua/lazyvim/plugins/ui.lua | 3 + lua/lazyvim/util/pick.lua | 6 +- 6 files changed, 147 insertions(+), 6 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/editor/snacks_picker.lua diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index c618578b..48726b02 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -150,12 +150,12 @@ end if vim.fn.executable("lazygit") == 1 then map("n", "gg", function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" }) map("n", "gG", function() Snacks.lazygit() end, { desc = "Lazygit (cwd)" }) - map("n", "gf", function() Snacks.lazygit.log_file() end, { desc = "Lazygit Current File History" }) - map("n", "gl", function() Snacks.lazygit.log({ cwd = LazyVim.root.git() }) end, { desc = "Lazygit Log" }) - map("n", "gL", function() Snacks.lazygit.log() end, { desc = "Lazygit Log (cwd)" }) + map("n", "gf", function() Snacks.picker.git_log_file() end, { desc = "Git Current File History" }) + map("n", "gl", function() Snacks.picker.git_log({ cwd = LazyVim.root.git() }) end, { desc = "Git Log" }) + map("n", "gL", function() Snacks.picker.git_log() end, { desc = "Git Log (cwd)" }) end -map("n", "gb", function() Snacks.git.blame_line() end, { desc = "Git Blame Line" }) +map("n", "gb", function() Snacks.picker.git_log_line() end, { desc = "Git Blame Line" }) map({ "n", "x" }, "gB", function() Snacks.gitbrowse() end, { desc = "Git Browse (open)" }) map({"n", "x" }, "gY", function() Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end, notify = false }) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f6a98605..95a1f7b9 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -397,4 +397,10 @@ return { return LazyVim.pick.want() == "telescope" end, }, + { + import = "lazyvim.plugins.extras.editor.snacks_picker", + enabled = function() + return LazyVim.pick.want() == "snacks" + end, + }, } diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index aa26f6e1..d4cd4093 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -286,6 +286,9 @@ return { { "neovim/nvim-lspconfig", opts = function() + if LazyVim.pick.want() ~= "fzf" then + return + end local Keys = require("lazyvim.plugins.lsp.keymaps").get() -- stylua: ignore vim.list_extend(Keys, { diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua new file mode 100644 index 00000000..c64775c2 --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -0,0 +1,127 @@ +if lazyvim_docs then + -- In case you don't want to use `:LazyExtras`, + -- then you need to set the option below. + vim.g.lazyvim_picker = "snacks" +end + +---@module 'snacks' + +---@type LazyPicker +local picker = { + name = "snacks", + commands = { + files = "files", + live_grep = "grep", + oldfiles = "recent", + }, + + ---@param source string + ---@param opts? snacks.picker.Config + open = function(source, opts) + return Snacks.picker.pick(source, opts) + end, +} +if not LazyVim.pick.register(picker) then + return {} +end + +return { + desc = "Fast and modern file picker", + -- recommended = true, + { + "folke/snacks.nvim", + opts = { + picker = {}, + }, + -- stylua: ignore + keys = { + { ",", function() Snacks.picker.buffers() end, desc = "Buffers" }, + { "/", LazyVim.pick("grep"), desc = "Grep (Root Dir)" }, + { ":", function() Snacks.picker.command_history() end, desc = "Command History" }, + { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, + -- find + { "fb", function() Snacks.picker.buffers() end, desc = "Buffers" }, + { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, + { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, + { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, + { "fg", function() Snacks.picker.git_files() end, desc = "Find Files (git-files)" }, + { "fr", LazyVim.pick("oldfiles"), desc = "Recent" }, + { "fR", LazyVim.pick("oldfiles", { only_cwd = true }), desc = "Recent (cwd)" }, + -- git + { "gc", function() Snacks.picker.git_log() end, desc = "Git Log" }, + { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, + -- Grep + { "sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" }, + { "sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" }, + { "sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, + { "sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, + { "sw", LazyVim.pick("grep_word"), desc = "Visual selection or word (Root Dir)", mode = { "n", "x" } }, + { "sW", LazyVim.pick("grep_word", { root = false }), desc = "Visual selection or word (cwd)", mode = { "n", "x" } }, + -- search + { 's"', function() Snacks.picker.registers() end, desc = "Registers" }, + { "sa", function() Snacks.picker.autocmds() end, desc = "Autocmds" }, + { "sc", function() Snacks.picker.command_history() end, desc = "Command History" }, + { "sC", function() Snacks.picker.commands() end, desc = "Commands" }, + { "sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, + { "sh", function() Snacks.picker.help() end, desc = "Help Pages" }, + { "sH", function() Snacks.picker.highlights() end, desc = "Highlights" }, + { "sj", function() Snacks.picker.jumps() end, desc = "Jumps" }, + { "sk", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, + { "sl", function() Snacks.picker.loclist() end, desc = "Location List" }, + { "sM", function() Snacks.picker.man() end, desc = "Man Pages" }, + { "sm", function() Snacks.picker.marks() end, desc = "Marks" }, + { "sR", function() Snacks.picker.resume() end, desc = "Resume" }, + { "sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" }, + { "uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" }, + { "qp", function() Snacks.picker.projects() end, desc = "Projects" }, + }, + }, + { + "folke/snacks.nvim", + opts = function(_, opts) + if LazyVim.has("trouble.nvim") then + return vim.tbl_deep_extend("force", opts or {}, { + picker = { + actions = require("trouble.sources.snacks").actions, + win = { + input = { + keys = { + [""] = { + "trouble_open", + mode = { "n", "i" }, + }, + }, + }, + }, + }, + }) + end + end, + }, + { + "neovim/nvim-lspconfig", + opts = function() + if LazyVim.pick.want() ~= "snacks" then + return + end + local Keys = require("lazyvim.plugins.lsp.keymaps").get() + -- stylua: ignore + vim.list_extend(Keys, { + { "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition", has = "definition" }, + { "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, + { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, + { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, + { "ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols", has = "documentSymbol" }, + }) + end, + }, + { + "folke/todo-comments.nvim", + optional = true, + -- stylua: ignore + keys = { + { "st", function() Snacks.picker.todo_comments() end, desc = "Todo" }, + { "sT", function () Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, + }, + }, +} diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index c4cb2a7b..d556d1f1 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -288,6 +288,9 @@ return { opts = { dashboard = { preset = { + pick = function(cmd, opts) + return LazyVim.pick(cmd, opts)() + end, header = [[ ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index 526025a3..2736d7a5 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -42,11 +42,13 @@ function M.register(picker) return true end ----@return "telescope" | "fzf" +---@return "telescope" | "fzf" | "snacks" function M.want() vim.g.lazyvim_picker = vim.g.lazyvim_picker or "auto" if vim.g.lazyvim_picker == "auto" then - return LazyVim.has_extra("editor.telescope") and "telescope" or "fzf" + return LazyVim.has_extra("editor.snacks_picker") and "snacks" + or LazyVim.has_extra("editor.telescope") and "telescope" + or "fzf" end return vim.g.lazyvim_picker end From 52dae02c436e03de721d73b81b671624f9414b8c Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Tue, 14 Jan 2025 21:55:09 +0000 Subject: [PATCH 03/78] 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 3d00d26d..1ec65752 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 08 +*LazyVim.txt* For Neovim Last change: 2025 January 14 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3660c52017462dfc472ff436261100a98ebea34d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 23:44:06 +0100 Subject: [PATCH 04/78] chore(main): release 14.7.0 (#5398) :robot: I have created a release *beep* *boop* --- ## [14.7.0](https://github.com/LazyVim/LazyVim/compare/v14.6.1...v14.7.0) (2025-01-14) ### Features * **extras:** added extra for snacks picker ([#5368](https://github.com/LazyVim/LazyVim/issues/5368)) ([13044c2](https://github.com/LazyVim/LazyVim/commit/13044c298ed1837a2d938b64710528d359dc8407)) --- 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 114400ff..7a337949 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "14.6.1" + ".": "14.7.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ea4a272..f48b40b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [14.7.0](https://github.com/LazyVim/LazyVim/compare/v14.6.1...v14.7.0) (2025-01-14) + + +### Features + +* **extras:** added extra for snacks picker ([#5368](https://github.com/LazyVim/LazyVim/issues/5368)) ([13044c2](https://github.com/LazyVim/LazyVim/commit/13044c298ed1837a2d938b64710528d359dc8407)) + ## [14.6.1](https://github.com/LazyVim/LazyVim/compare/v14.6.0...v14.6.1) (2025-01-08) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index fbe6b74c..102ace9d 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 = "14.6.1" -- x-release-please-version +M.version = "14.7.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 8307b0fe506a38417f3b7835e2c4b43d9a970946 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Wed, 15 Jan 2025 20:53:56 +0200 Subject: [PATCH 05/78] fix(snacks.picker): fix mapping for `Recent (cwd)` (#5407) ## Description The mapping `fR` was showing all recent files instead of the ones in the `cwd` only. ## Related Issue(s) None ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index c64775c2..522c4ce5 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -46,7 +46,7 @@ return { { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, { "fg", function() Snacks.picker.git_files() end, desc = "Find Files (git-files)" }, { "fr", LazyVim.pick("oldfiles"), desc = "Recent" }, - { "fR", LazyVim.pick("oldfiles", { only_cwd = true }), desc = "Recent (cwd)" }, + { "fR", LazyVim.pick("oldfiles", { filter = { cwd = true }}), desc = "Recent (cwd)" }, -- git { "gc", function() Snacks.picker.git_log() end, desc = "Git Log" }, { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, From 6aefa8ec3ea1918957dd7c30de4c8db18a34e0b4 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:54:50 +0000 Subject: [PATCH 06/78] 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 1ec65752..c5ca33d7 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 14 +*LazyVim.txt* For Neovim Last change: 2025 January 15 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 62cb4a465c490c7d41f7a3bf52fb0e222f2cf83b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 Jan 2025 09:58:28 +0100 Subject: [PATCH 07/78] feat(snacks): added git diff keymap to pick hunks with leader-gd --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 522c4ce5..4036a4f0 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -49,6 +49,7 @@ return { { "fR", LazyVim.pick("oldfiles", { filter = { cwd = true }}), desc = "Recent (cwd)" }, -- git { "gc", function() Snacks.picker.git_log() end, desc = "Git Log" }, + { "gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" }, { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, -- Grep { "sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" }, From 915aab99ef950ae4a7d8b3f967de3412f366bfd9 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Thu, 16 Jan 2025 08:59:38 +0000 Subject: [PATCH 08/78] 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 c5ca33d7..0e78cf3d 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 15 +*LazyVim.txt* For Neovim Last change: 2025 January 16 ============================================================================== Table of Contents *LazyVim-table-of-contents* From b19f2070b847a3067436f4d16a0cc5b84a9f9819 Mon Sep 17 00:00:00 2001 From: Yusuf Aktepe Date: Thu, 16 Jan 2025 12:01:30 +0300 Subject: [PATCH 09/78] feat(dial): add checkbox augend for markdown (#5411) ## Description Added support for markdown checkboxes. ( **[ ]** <-> **[x]** ) ## Related Issue(s) ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/dial.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/dial.lua b/lua/lazyvim/plugins/extras/editor/dial.lua index a9f7bb26..602b747c 100644 --- a/lua/lazyvim/plugins/extras/editor/dial.lua +++ b/lua/lazyvim/plugins/extras/editor/dial.lua @@ -140,6 +140,11 @@ return { }), }, markdown = { + augend.constant.new({ + elements = { "[ ]", "[x]" }, + word = false, + cyclic = true, + }), augend.misc.alias.markdown_header, }, json = { From 4f31bfab86402c819e5ea1e18b3c5d139628c864 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 Jan 2025 10:05:30 +0100 Subject: [PATCH 10/78] fix(markdown): disable checkbox rendering since it's annoying to edit --- lua/lazyvim/plugins/extras/lang/markdown.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index e7977cb5..a73fe114 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -104,6 +104,9 @@ return { sign = false, icons = {}, }, + checkbox = { + enabled = false, + }, }, ft = { "markdown", "norg", "rmd", "org" }, config = function(_, opts) From df7426eefa79d5dfa2fcbe2f381abfb2cca70bad Mon Sep 17 00:00:00 2001 From: Riri Date: Thu, 16 Jan 2025 18:37:59 +0800 Subject: [PATCH 11/78] fix(snacks.picker): respect lazyvim.config.kind_filter (#5415) ## Description Currently, snacks.picker does not filter symbols based on the kind_filter configured in lazyvim. This PR addresses that issue. ## Screenshots nil ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. Co-authored-by: ding.zhao --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 4036a4f0..601fcf1b 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -112,7 +112,7 @@ return { { "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, - { "ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols", has = "documentSymbol" }, + { "ss", function() Snacks.picker.lsp_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Symbols", has = "documentSymbol" }, }) end, }, From b729e653182abab3089903baf62a8d5b65bfe36d Mon Sep 17 00:00:00 2001 From: Jorge Villalobos Date: Fri, 17 Jan 2025 04:00:30 -0500 Subject: [PATCH 12/78] refactor(blink): color swatch icon upstreamed (#5141) ## Description I've upstreamed the block char vs. icon replacement for Tailwind colors so we shouldn't need this here anymore. I've replaced it by extending the default blink icons instead, just in case they introduce an icon which isn't yet covered by Lazy's, it would still show up (unlikely, but better, no?). ## Related Issue(s) none ## Screenshots none ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/coding/blink.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/blink.lua b/lua/lazyvim/plugins/extras/coding/blink.lua index 81762b8d..45e393e1 100644 --- a/lua/lazyvim/plugins/extras/coding/blink.lua +++ b/lua/lazyvim/plugins/extras/coding/blink.lua @@ -158,9 +158,7 @@ return { "saghen/blink.cmp", opts = function(_, opts) opts.appearance = opts.appearance or {} - opts.appearance.kind_icons = vim.tbl_extend("keep", { - Color = "██", -- Use block instead of icon for color items to make swatches more usable - }, LazyVim.config.icons.kinds) + opts.appearance.kind_icons = vim.tbl_extend("force", opts.appearance.kind_icons or {}, LazyVim.config.icons.kinds) end, }, From b574f01af7ab5eaccdef16db60c1fdd94e8ff12d Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Fri, 17 Jan 2025 09:01:25 +0000 Subject: [PATCH 13/78] 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 0e78cf3d..e076c4bf 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 16 +*LazyVim.txt* For Neovim Last change: 2025 January 17 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 970d1a05da37554aa17b671c869431a7b387d8be Mon Sep 17 00:00:00 2001 From: Imron Gamidli <36050790+gogamid@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:52:25 +0100 Subject: [PATCH 14/78] feat(chezmoi): add snacks picker integration for chezmoi files (#5429) ## Description We have a new picker Snacks picker, it means telescope and fzf-lua can be uninstalled. But chezmoi files still listed only with telescope and fzf-lua. In this pr we add snacks.picker integration if the user has chosen snacks.picker in the LazyVimExtras. --- lua/lazyvim/plugins/extras/util/chezmoi.lua | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lua/lazyvim/plugins/extras/util/chezmoi.lua b/lua/lazyvim/plugins/extras/util/chezmoi.lua index 633f3008..cffa6749 100644 --- a/lua/lazyvim/plugins/extras/util/chezmoi.lua +++ b/lua/lazyvim/plugins/extras/util/chezmoi.lua @@ -19,6 +19,38 @@ local pick_chezmoi = function() }, } fzf_lua.fzf_exec(results, opts) + elseif LazyVim.pick.picker.name == "snacks" then + local results = require("chezmoi.commands").list({ + args = { + "--path-style", + "absolute", + "--include", + "files", + "--exclude", + "externals", + }, + }) + local items = {} + + for _, czFile in ipairs(results) do + table.insert(items, { + text = czFile, + file = czFile, + }) + end + + ---@type snacks.picker.Config + local opts = { + items = items, + confirm = function(picker, item) + picker:close() + require("chezmoi.commands").edit({ + targets = { item.text }, + args = { "--watch" }, + }) + end, + } + Snacks.picker.pick(opts) end end From 4e8d75144de92e62eb58c87f61938118d3b1e37c Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:53:19 +0000 Subject: [PATCH 15/78] 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 e076c4bf..d40afbc0 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 17 +*LazyVim.txt* For Neovim Last change: 2025 January 18 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 8787ec1227e10123ad7291cf916020d9a8626525 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 Jan 2025 18:33:47 +0100 Subject: [PATCH 16/78] feat(snacks.picker): added leader-sS to search lsp workspace symbols --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 601fcf1b..bd4d7677 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -113,6 +113,7 @@ return { { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, { "ss", function() Snacks.picker.lsp_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Symbols", has = "documentSymbol" }, + { "sS", function() Snacks.picker.lsp_workspace_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Workspace Symbols", has = "workspace/symbols" }, }) end, }, From 8f58fe0b62ddd3ed23816ca7ae3b6d369a565dc5 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Sun, 19 Jan 2025 17:34:47 +0000 Subject: [PATCH 17/78] 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 d40afbc0..bd9b385d 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 18 +*LazyVim.txt* For Neovim Last change: 2025 January 19 ============================================================================== Table of Contents *LazyVim-table-of-contents* From eb7b453b48ab7e3008013e0edf2822f622111e97 Mon Sep 17 00:00:00 2001 From: Daniel Chong Date: Mon, 20 Jan 2025 23:55:51 +1300 Subject: [PATCH 18/78] fix(snacks.picker): fix mapping for Projects for consistency (#5433) ## Description `fp` is the mapping for Telescope and fzf for [Projects](https://www.lazyvim.org/extras/util/project). This PR makes this shortcut consistent for snacks picker. ## Related Issue(s) ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index bd4d7677..e286dff3 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -74,7 +74,7 @@ return { { "sR", function() Snacks.picker.resume() end, desc = "Resume" }, { "sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" }, { "uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" }, - { "qp", function() Snacks.picker.projects() end, desc = "Projects" }, + { "fp", function() Snacks.picker.projects() end, desc = "Projects" }, }, }, { From 0e5d17537a433b0e8dc6d5e88eb4df4e69dbefc2 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:56:42 +0000 Subject: [PATCH 19/78] 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 bd9b385d..23f8a322 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 19 +*LazyVim.txt* For Neovim Last change: 2025 January 20 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 66c3577bc779d31a7c2addd47de7cc6d215795ba Mon Sep 17 00:00:00 2001 From: Junyi Liu Date: Mon, 20 Jan 2025 07:16:14 -0500 Subject: [PATCH 20/78] perf(java): setting opts.dap_main to false to disable main class scan (#5391) ## Description For large Java project, calling `require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main)` has a huge performance impact on the LSP. I tested on a Java project with 3.7K java source files and 12K other files, a simple go_definition can take about 20-30 seconds. This change allow user to set the `opts.dap_main` to false so we can skip the main class scan. By using the `.lazy.lua` project specific setting, we can easily customize this option per project. ## Related Issue(s) #5387 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/java.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 520776fe..236c86c9 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -130,6 +130,7 @@ return { -- These depend on nvim-dap, but can additionally be disabled by setting false here. dap = { hotcodereplace = "auto", config_overrides = {} }, + -- Can set this to false to disable main class scan, which is a performance killer for large project dap_main = {}, test = true, settings = { @@ -246,7 +247,9 @@ return { if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then -- custom init for Java debugger require("jdtls").setup_dap(opts.dap) - require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main) + if opts.dap_main then + require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main) + end -- Java Test require Java debugger to work if opts.test and mason_registry.is_installed("java-test") then From 2bea40c447b72e54ffb2d5cddc98d7798990796f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 13:50:28 +0100 Subject: [PATCH 21/78] chore(main): release 14.8.0 (#5409) :robot: I have created a release *beep* *boop* --- ## [14.8.0](https://github.com/LazyVim/LazyVim/compare/v14.7.0...v14.8.0) (2025-01-20) ### Features * **chezmoi:** add snacks picker integration for chezmoi files ([#5429](https://github.com/LazyVim/LazyVim/issues/5429)) ([970d1a0](https://github.com/LazyVim/LazyVim/commit/970d1a05da37554aa17b671c869431a7b387d8be)) * **dial:** add checkbox augend for markdown ([#5411](https://github.com/LazyVim/LazyVim/issues/5411)) ([b19f207](https://github.com/LazyVim/LazyVim/commit/b19f2070b847a3067436f4d16a0cc5b84a9f9819)) * **snacks.picker:** added leader-sS to search lsp workspace symbols ([8787ec1](https://github.com/LazyVim/LazyVim/commit/8787ec1227e10123ad7291cf916020d9a8626525)) * **snacks:** added git diff keymap to pick hunks with leader-gd ([62cb4a4](https://github.com/LazyVim/LazyVim/commit/62cb4a465c490c7d41f7a3bf52fb0e222f2cf83b)) ### Bug Fixes * **markdown:** disable checkbox rendering since it's annoying to edit ([4f31bfa](https://github.com/LazyVim/LazyVim/commit/4f31bfab86402c819e5ea1e18b3c5d139628c864)) * **snacks.picker:** fix mapping for `Recent (cwd)` ([#5407](https://github.com/LazyVim/LazyVim/issues/5407)) ([8307b0f](https://github.com/LazyVim/LazyVim/commit/8307b0fe506a38417f3b7835e2c4b43d9a970946)) * **snacks.picker:** fix mapping for Projects for consistency ([#5433](https://github.com/LazyVim/LazyVim/issues/5433)) ([eb7b453](https://github.com/LazyVim/LazyVim/commit/eb7b453b48ab7e3008013e0edf2822f622111e97)) * **snacks.picker:** respect lazyvim.config.kind_filter ([#5415](https://github.com/LazyVim/LazyVim/issues/5415)) ([df7426e](https://github.com/LazyVim/LazyVim/commit/df7426eefa79d5dfa2fcbe2f381abfb2cca70bad)) ### Performance Improvements * **java:** setting opts.dap_main to false to disable main class scan ([#5391](https://github.com/LazyVim/LazyVim/issues/5391)) ([66c3577](https://github.com/LazyVim/LazyVim/commit/66c3577bc779d31a7c2addd47de7cc6d215795ba)) --- 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 | 23 +++++++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 7a337949..b3c4f00b 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "14.7.0" + ".": "14.8.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index f48b40b9..1057fb57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [14.8.0](https://github.com/LazyVim/LazyVim/compare/v14.7.0...v14.8.0) (2025-01-20) + + +### Features + +* **chezmoi:** add snacks picker integration for chezmoi files ([#5429](https://github.com/LazyVim/LazyVim/issues/5429)) ([970d1a0](https://github.com/LazyVim/LazyVim/commit/970d1a05da37554aa17b671c869431a7b387d8be)) +* **dial:** add checkbox augend for markdown ([#5411](https://github.com/LazyVim/LazyVim/issues/5411)) ([b19f207](https://github.com/LazyVim/LazyVim/commit/b19f2070b847a3067436f4d16a0cc5b84a9f9819)) +* **snacks.picker:** added leader-sS to search lsp workspace symbols ([8787ec1](https://github.com/LazyVim/LazyVim/commit/8787ec1227e10123ad7291cf916020d9a8626525)) +* **snacks:** added git diff keymap to pick hunks with leader-gd ([62cb4a4](https://github.com/LazyVim/LazyVim/commit/62cb4a465c490c7d41f7a3bf52fb0e222f2cf83b)) + + +### Bug Fixes + +* **markdown:** disable checkbox rendering since it's annoying to edit ([4f31bfa](https://github.com/LazyVim/LazyVim/commit/4f31bfab86402c819e5ea1e18b3c5d139628c864)) +* **snacks.picker:** fix mapping for `Recent (cwd)` ([#5407](https://github.com/LazyVim/LazyVim/issues/5407)) ([8307b0f](https://github.com/LazyVim/LazyVim/commit/8307b0fe506a38417f3b7835e2c4b43d9a970946)) +* **snacks.picker:** fix mapping for Projects for consistency ([#5433](https://github.com/LazyVim/LazyVim/issues/5433)) ([eb7b453](https://github.com/LazyVim/LazyVim/commit/eb7b453b48ab7e3008013e0edf2822f622111e97)) +* **snacks.picker:** respect lazyvim.config.kind_filter ([#5415](https://github.com/LazyVim/LazyVim/issues/5415)) ([df7426e](https://github.com/LazyVim/LazyVim/commit/df7426eefa79d5dfa2fcbe2f381abfb2cca70bad)) + + +### Performance Improvements + +* **java:** setting opts.dap_main to false to disable main class scan ([#5391](https://github.com/LazyVim/LazyVim/issues/5391)) ([66c3577](https://github.com/LazyVim/LazyVim/commit/66c3577bc779d31a7c2addd47de7cc6d215795ba)) + ## [14.7.0](https://github.com/LazyVim/LazyVim/compare/v14.6.1...v14.7.0) (2025-01-14) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 102ace9d..8a0b2ced 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 = "14.7.0" -- x-release-please-version +M.version = "14.8.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From dc8512fce1ec1cd4b0ca52d1077b2ed3894d51c8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 Jan 2025 20:21:01 +0100 Subject: [PATCH 22/78] fix(root): pass args to root.get --- lua/lazyvim/util/root.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index b723b227..fc6d6d7d 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -1,8 +1,8 @@ ---@class lazyvim.util.root ---@overload fun(): string local M = setmetatable({}, { - __call = function(m) - return m.get() + __call = function(m, ...) + return m.get(...) end, }) From 6be7c4fee4fb755ff07f7bcc13eac96e1d8c279a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 Jan 2025 20:21:23 +0100 Subject: [PATCH 23/78] feat(snacks.picker): added alt-c to toggle between cwd/root dir --- .../plugins/extras/editor/snacks_picker.lua | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index e286dff3..2b623179 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -27,11 +27,32 @@ end return { desc = "Fast and modern file picker", - -- recommended = true, + recommended = true, { "folke/snacks.nvim", opts = { - picker = {}, + picker = { + win = { + input = { + keys = { + [""] = { + "toggle_cwd", + mode = { "n", "i" }, + }, + }, + }, + }, + actions = { + ---@param p snacks.Picker + toggle_cwd = function(p) + local root = LazyVim.root({ buf = p.input.filter.current_buf, normalize = true }) + local cwd = vim.fs.normalize((vim.uv or vim.loop).cwd() or ".") + local current = p:cwd() + p:set_cwd(current == root and cwd or root) + p:find() + end, + }, + }, }, -- stylua: ignore keys = { From c7a7ab51129692927ae47f4e57ce22d10d48467e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 Jan 2025 20:30:39 +0100 Subject: [PATCH 24/78] fix(vscode): diabled some snacks plugins. Fixes #5364 --- lua/lazyvim/plugins/extras/vscode.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/vscode.lua b/lua/lazyvim/plugins/extras/vscode.lua index b9b1e0b1..5115a2b4 100644 --- a/lua/lazyvim/plugins/extras/vscode.lua +++ b/lua/lazyvim/plugins/extras/vscode.lua @@ -57,9 +57,14 @@ return { { "snacks.nvim", opts = { + bigfile = { enabled = false }, + dashboard = { enabled = false }, indent = { enabled = false }, - scroll = { enabled = false }, + input = { enabled = false }, notifier = { enabled = false }, + picker = { enabled = false }, + quickfile = { enabled = false }, + scroll = { enabled = false }, statuscolumn = { enabled = false }, }, }, From 1e83b4f843f88678189df81b1c88a400c53abdbc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 Jan 2025 20:32:17 +0100 Subject: [PATCH 25/78] fix(sql): better nvim-cmp check. Closes #5188 --- lua/lazyvim/plugins/extras/lang/sql.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/sql.lua b/lua/lazyvim/plugins/extras/lang/sql.lua index 075182d6..83de5ee1 100644 --- a/lua/lazyvim/plugins/extras/lang/sql.lua +++ b/lua/lazyvim/plugins/extras/lang/sql.lua @@ -48,7 +48,7 @@ return { vim.api.nvim_create_autocmd("FileType", { pattern = sql_ft, callback = function() - if LazyVim.has("nvim-cmp") then + if LazyVim.cmp_engine() == "nvim-cmp" then local cmp = require("cmp") -- global sources From 8b4e6ff70d682cad3b1f4999623c3f0ac639fa82 Mon Sep 17 00:00:00 2001 From: abeldekat <58370433+abeldekat@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:03:36 +0000 Subject: [PATCH 26/78] feat(snippets): an extra for mini.snippets (#5274) ## Description Mini.snippets, a plugin to manage and expand snippets, is currently in [beta](https://github.com/echasnovski/mini.nvim/issues/1428). I think the plugin is a very interesting alternative to `luasnip`. The following `lazydoc` will be added: ```lua if lazyvim_docs then -- Set to `false` to prevent "non-lsp snippets"" from appearing inside completion windows -- Motivation: Less clutter in completion windows and a more direct usage of snippits vim.g.lazyvim_mini_snippets_in_completion = true -- Using default mini.snippets, completion suggestions might appear directly after inserting a snippet -- This extra prevents that from happening. -- Motivation: A better display of the current snippet. -- Also, those completions do not appear when using luasnip or native snippets -- -- Set to `false` to enable completion suggestions directly after inserting a snippet vim.g.lazyvim_mini_snippets_override_expand_insert = true -- NOTE: Please also read: -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-snippets.md#expand -- :h MiniSnippets-session -- Example override for your own config: --[[ return { { "echasnovski/mini.snippets", opts = function(_, opts) -- By default, for opts.snippets, the extra for mini.snippets only adds gen_loader.from_lang() -- This provides a sensible quickstart, integrating with friendly-snippets -- and your own language-specific snippets -- -- In order to change opts.snippets, replace the entire table inside your own opts local snippets, config_path = require("mini.snippets"), vim.fn.stdpath("config") opts.snippets = { -- override opts.snippets provided by extra... -- Load custom file with global snippets first (order matters) snippets.gen_loader.from_file(config_path .. "/snippets/global.json"), -- Load snippets based on current language by reading files from -- "snippets/" subdirectories from 'runtimepath' directories. snippets.gen_loader.from_lang(), -- this is the default in the extra... } end, }, } --]] end ``` It's possible to use the code from this PR directly in your own configuration: 1. Copy the code to lua/extras/coding/mini_snippets.lua in your config folder 2. Restart nvim and enable the "user" extra for `mini.snippets` 3. Restart nvim ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: abeldekat --- .../plugins/extras/coding/mini-snippets.lua | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/coding/mini-snippets.lua diff --git a/lua/lazyvim/plugins/extras/coding/mini-snippets.lua b/lua/lazyvim/plugins/extras/coding/mini-snippets.lua new file mode 100644 index 00000000..f68af110 --- /dev/null +++ b/lua/lazyvim/plugins/extras/coding/mini-snippets.lua @@ -0,0 +1,167 @@ +if lazyvim_docs then + -- Set to `false` to prevent "non-lsp snippets"" from appearing inside completion windows + -- Motivation: Less clutter in completion windows and a more direct usage of snippits + vim.g.lazyvim_mini_snippets_in_completion = true + + -- NOTE: Please also read: + -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-snippets.md#expand + -- :h MiniSnippets-session + + -- Example override for your own config: + --[[ + return { + { + "echasnovski/mini.snippets", + opts = function(_, opts) + -- By default, for opts.snippets, the extra for mini.snippets only adds gen_loader.from_lang() + -- This provides a sensible quickstart, integrating with friendly-snippets + -- and your own language-specific snippets + -- + -- In order to change opts.snippets, replace the entire table inside your own opts + + local snippets, config_path = require("mini.snippets"), vim.fn.stdpath("config") + + opts.snippets = { -- override opts.snippets provided by extra... + -- Load custom file with global snippets first (order matters) + snippets.gen_loader.from_file(config_path .. "/snippets/global.json"), + + -- Load snippets based on current language by reading files from + -- "snippets/" subdirectories from 'runtimepath' directories. + snippets.gen_loader.from_lang(), -- this is the default in the extra... + } + end, + }, + } +--]] +end + +local include_in_completion = vim.g.lazyvim_mini_snippets_in_completion == nil + or vim.g.lazyvim_mini_snippets_in_completion + +local function expand_from_lsp(snippet) + local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert + insert({ body = snippet }) +end + +local function jump(direction) + local is_active = MiniSnippets.session.get(false) ~= nil + if is_active then + MiniSnippets.session.jump(direction) + return true + end +end + +---@type fun(snippets, insert) | nil +local expand_select_override = nil + +return { + -- disable builtin snippet support: + { "garymjr/nvim-snippets", optional = true, enabled = false }, + -- disable luasnip: + { "L3MON4D3/LuaSnip", optional = true, enabled = false }, + + -- add mini.snippets + desc = "mini.snippets(beta), a plugin to manage and expand snippets (alternative for luasnip)", + { + "echasnovski/mini.snippets", + event = "InsertEnter", -- don't depend on other plugins to load... + dependencies = "rafamadriz/friendly-snippets", + opts = function() + ---@diagnostic disable-next-line: duplicate-set-field + LazyVim.cmp.actions.snippet_stop = function() end -- by design, should not stop the session! + ---@diagnostic disable-next-line: duplicate-set-field + LazyVim.cmp.actions.snippet_forward = function() + return jump("next") + end + + local mini_snippets = require("mini.snippets") + return { + snippets = { mini_snippets.gen_loader.from_lang() }, + + -- Following the behavior of vim.snippets, + -- the intended usage of is to be able to temporarily exit into normal mode for quick edits. + -- + -- If you'd rather stop the snippet on , activate the line below in your own config: + -- mappings = { stop = "" }, -- by default, see :h MiniSnippets-session + + expand = { + select = function(snippets, insert) + -- Close completion window on snippet select - vim.ui.select + -- Needed to remove virtual text for fzf-lua and telescope, but not for mini.pick... + local select = expand_select_override or MiniSnippets.default_select + select(snippets, insert) + end, + }, + } + end, + }, + + -- nvim-cmp integration + { + "hrsh7th/nvim-cmp", + optional = true, + dependencies = include_in_completion and { "abeldekat/cmp-mini-snippets" } or nil, + opts = function(_, opts) + local cmp = require("cmp") + local cmp_config = require("cmp.config") + + opts.snippet = { + expand = function(args) + expand_from_lsp(args.body) + cmp.resubscribe({ "TextChangedI", "TextChangedP" }) + cmp_config.set_onetime({ sources = {} }) + end, + } + + if include_in_completion then + table.insert(opts.sources, { name = "mini_snippets" }) + else + expand_select_override = function(snippets, insert) + -- stylua: ignore + if cmp.visible() then cmp.close() end + MiniSnippets.default_select(snippets, insert) + end + end + end, + -- stylua: ignore + -- counterpart to defined in cmp.mappings + keys = include_in_completion and { { "", function() jump("prev") end, mode = "i" } } or nil, + }, + + -- blink.cmp integration + { + "saghen/blink.cmp", + optional = true, + opts = function(_, opts) + -- Return early + if include_in_completion then + opts.snippets = { preset = "mini_snippets" } + return + end + + -- Standalone -- + expand_select_override = function(snippets, insert) + -- Schedule, otherwise blink's virtual text is not removed on vim.ui.select + require("blink.cmp").cancel() + vim.schedule(function() + MiniSnippets.default_select(snippets, insert) + end) + end + -- + -- Blink performs a require on blink.cmp.sources.snippets.default + -- By removing the source, the default engine will not be used + opts.sources.default = vim.tbl_filter(function(source) + return source ~= "snippets" + end, opts.sources.default) + opts.snippets = { -- need to repeat blink's preset here + expand = expand_from_lsp, + active = function() + return MiniSnippets.session.get(false) ~= nil + end, + jump = function(direction) + jump(direction == -1 and "prev" or "next") + end, + } + end, + }, +} From 7fb320700ad0162be33ce816f2ba6f9dda41883f Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:04:34 +0000 Subject: [PATCH 27/78] 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 23f8a322..285451bb 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 20 +*LazyVim.txt* For Neovim Last change: 2025 January 23 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 332b32080c52727a16db90e06989caa0c378caa1 Mon Sep 17 00:00:00 2001 From: Jorge Villalobos Date: Thu, 23 Jan 2025 10:51:36 -0500 Subject: [PATCH 28/78] feat(snacks.picker): added su to search undotree (#5447) ## Description As it reads on the title ;) ## Related Issue(s) None. ## Screenshots ![Screenshot 2025-01-22 at 14 02 30](https://github.com/user-attachments/assets/f8d2ba88-f279-4715-8120-7610c58bd269) ![Screenshot 2025-01-22 at 14 03 04](https://github.com/user-attachments/assets/08bc1b26-f49c-4f25-ad66-1166a3f72605) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 2b623179..f47a2b29 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -68,6 +68,7 @@ return { { "fg", function() Snacks.picker.git_files() end, desc = "Find Files (git-files)" }, { "fr", LazyVim.pick("oldfiles"), desc = "Recent" }, { "fR", LazyVim.pick("oldfiles", { filter = { cwd = true }}), desc = "Recent (cwd)" }, + { "fp", function() Snacks.picker.projects() end, desc = "Projects" }, -- git { "gc", function() Snacks.picker.git_log() end, desc = "Git Log" }, { "gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" }, @@ -94,8 +95,9 @@ return { { "sm", function() Snacks.picker.marks() end, desc = "Marks" }, { "sR", function() Snacks.picker.resume() end, desc = "Resume" }, { "sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" }, + { "su", function() Snacks.picker.undo() end, desc = "Undotree" }, + -- ui { "uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" }, - { "fp", function() Snacks.picker.projects() end, desc = "Projects" }, }, }, { From eea52be3447502dde77d9e6fa75fd597a0b5a86a Mon Sep 17 00:00:00 2001 From: Jorge Villalobos Date: Thu, 23 Jan 2025 13:19:48 -0500 Subject: [PATCH 29/78] feat(snacks.picker): added si to search icons (#5460) ## Description As it reads on the tin can. ## Related Issue(s) N/A ## Screenshots ![Screenshot 2025-01-23 at 11 49 49](https://github.com/user-attachments/assets/6c4d0e9a-0a8e-4128-9ef1-b7954ece2bc7) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index f47a2b29..fd08004b 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -88,6 +88,7 @@ return { { "sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, { "sh", function() Snacks.picker.help() end, desc = "Help Pages" }, { "sH", function() Snacks.picker.highlights() end, desc = "Highlights" }, + { "si", function() Snacks.picker.icons() end, desc = "Icons" }, { "sj", function() Snacks.picker.jumps() end, desc = "Jumps" }, { "sk", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, { "sl", function() Snacks.picker.loclist() end, desc = "Location List" }, From 7cf4185dc4d1fe49ad004d33a6703603fb4500ff Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 23 Jan 2025 19:22:19 +0100 Subject: [PATCH 30/78] feat(snacks.picker): added `leader-sp` to search for plugin spec --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index fd08004b..e7a99239 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -78,6 +78,7 @@ return { { "sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" }, { "sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, { "sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, + { "sp", function() Snacks.picker.lazy() end, desc = "Search for Plugin Spec" }, { "sw", LazyVim.pick("grep_word"), desc = "Visual selection or word (Root Dir)", mode = { "n", "x" } }, { "sW", LazyVim.pick("grep_word", { root = false }), desc = "Visual selection or word (cwd)", mode = { "n", "x" } }, -- search From 83bf6360a1f28a3fc1afe31ae300247fc01c7a90 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 23 Jan 2025 19:22:47 +0100 Subject: [PATCH 31/78] feat(snacks.picker): added `leader-fB` to find any buffer (including hidden & nofile) --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index e7a99239..48bb7861 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -62,6 +62,7 @@ return { { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, -- find { "fb", function() Snacks.picker.buffers() end, desc = "Buffers" }, + { "fB", function() Snacks.picker.buffers({ hidden = true, nofile = true }) end, desc = "Buffers (all)" }, { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, From 0350934d56579f3e6a9d40fa47313b2970d74772 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Tue, 28 Jan 2025 10:19:01 +0200 Subject: [PATCH 32/78] fix(luasnip): schedule `jump` to be compatible with blink, nvim-cmp still works after change (#5470) ## Description Schedule `jump` in Luasnip `snippet_forward`, so that it doesn't get stuck before the last placeholder. ## Related Issue(s) Fixes #5469 ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/coding/luasnip.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/coding/luasnip.lua b/lua/lazyvim/plugins/extras/coding/luasnip.lua index 8b3daed7..85ed2fd5 100644 --- a/lua/lazyvim/plugins/extras/coding/luasnip.lua +++ b/lua/lazyvim/plugins/extras/coding/luasnip.lua @@ -30,7 +30,9 @@ return { opts = function() LazyVim.cmp.actions.snippet_forward = function() if require("luasnip").jumpable(1) then - require("luasnip").jump(1) + vim.schedule(function() + require("luasnip").jump(1) + end) return true end end From a3b459c1a58f6f8048f5259484e166090542400d Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Tue, 28 Jan 2025 08:20:18 +0000 Subject: [PATCH 33/78] 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 285451bb..cc9c3d9d 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 23 +*LazyVim.txt* For Neovim Last change: 2025 January 28 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 132986a624b49bf740161d90ce94f16dd5ea5883 Mon Sep 17 00:00:00 2001 From: iniw Date: Tue, 28 Jan 2025 08:42:48 -0300 Subject: [PATCH 34/78] fix(keymaps): remove unneeded and ambiguous `w` keymap (#5459) ## Description The `w` mapping, described as "Windows", was causing potentially timeout-related bugs with many other mappings that also started with `w`. The problems caused by this are described in detail in issue #5456 and in discussion #4157. @dpetka2001 Suggested removing it as an experiment, which I tried and found to work. ## Checklist - [X] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/config/keymaps.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 48726b02..3e3829d1 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -182,7 +182,6 @@ map("t", "", "close", { desc = "Hide Terminal" }) map("t", "", "close", { desc = "which_key_ignore" }) -- windows -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 }) From 01a70cc60ed2760afc819510177fb8d12a371b25 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 Jan 2025 17:22:17 +0100 Subject: [PATCH 35/78] feat(snacks.picker): use snacks picker for notifications when enabled --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 1 + lua/lazyvim/plugins/ui.lua | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 48bb7861..e6110175 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -60,6 +60,7 @@ return { { "/", LazyVim.pick("grep"), desc = "Grep (Root Dir)" }, { ":", function() Snacks.picker.command_history() end, desc = "Command History" }, { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, + { "n", function() Snacks.picker.notifications() end, desc = "Notification History" }, -- find { "fb", function() Snacks.picker.buffers() end, desc = "Buffers" }, { "fB", function() Snacks.picker.buffers({ hidden = true, nofile = true }) end, desc = "Buffers (all)" }, diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index d556d1f1..6e03a217 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -278,7 +278,13 @@ return { }, -- stylua: ignore keys = { - { "n", function() Snacks.notifier.show_history() end, desc = "Notification History" }, + { "n", function() + if Snacks.config.picker and Snacks.config.picker.enabled then + Snacks.picker.notifications() + else + Snacks.notifier.show_history() + end + end, desc = "Notification History" }, { "un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" }, }, }, From f0d2629bd859eeac343999b0fe145f9beb227c4a Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Tue, 28 Jan 2025 19:55:02 +0200 Subject: [PATCH 36/78] fix(snacks): use `Snacks.picker` for recent files (#5485) ## Description Use `Snacks.picker` for recent files instead of `LazyVim.pick`, because `root_dir` is being propagated to `opts.cwd` and does not correctly filter out recent files when inside nested directories. ## Related Issue(s) None ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index e6110175..19a8faf3 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -69,7 +69,7 @@ return { { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, { "fg", function() Snacks.picker.git_files() end, desc = "Find Files (git-files)" }, { "fr", LazyVim.pick("oldfiles"), desc = "Recent" }, - { "fR", LazyVim.pick("oldfiles", { filter = { cwd = true }}), desc = "Recent (cwd)" }, + { "fR", function() Snacks.picker.recent({ filter = { cwd = true }}) end, desc = "Recent (cwd)" }, { "fp", function() Snacks.picker.projects() end, desc = "Projects" }, -- git { "gc", function() Snacks.picker.git_log() end, desc = "Git Log" }, From 5d24aa63111af68fbada8c97fedb75b07b8c3c92 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 Jan 2025 20:18:43 +0100 Subject: [PATCH 37/78] feat(snacks.picker): flash.nvim integration --- .../plugins/extras/editor/snacks_picker.lua | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 19a8faf3..85e6fe72 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -153,4 +153,45 @@ return { { "sT", function () Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, }, }, + { + "folke/snacks.nvim", + optional = true, + specs = { + { + "folke/snacks.nvim", + opts = { + picker = { + win = { + input = { + keys = { + [""] = { "flash", mode = { "n", "i" } }, + ["s"] = { "flash" }, + }, + }, + }, + actions = { + flash = function(picker) + require("flash").jump({ + pattern = "^", + label = { after = { 0, 0 } }, + search = { + mode = "search", + exclude = { + function(win) + return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "snacks_picker_list" + end, + }, + }, + action = function(match) + local idx = picker.list:row2idx(match.pos[1]) + picker.list:move(idx, true) + end, + }) + end, + }, + }, + }, + }, + }, + }, } From 63a39ef8cfe9641f1e621473dfc859c8032a4169 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:19:59 +0000 Subject: [PATCH 38/78] 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 cc9c3d9d..ea390859 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 28 +*LazyVim.txt* For Neovim Last change: 2025 January 29 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3de7b24cf6ed844772ea047476a400c56d5f4b42 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 Jan 2025 21:06:36 +0100 Subject: [PATCH 39/78] fix(snacks.picker): snacks => flash --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 85e6fe72..f6f16791 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -154,7 +154,7 @@ return { }, }, { - "folke/snacks.nvim", + "folke/flash.nvim", optional = true, specs = { { From b5cd0d0e27081be3ef1905475a0fe541b7661870 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 Jan 2025 23:21:59 +0100 Subject: [PATCH 40/78] fix(snacks.picker): flash integration --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index f6f16791..b6b6deee 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -184,7 +184,7 @@ return { }, action = function(match) local idx = picker.list:row2idx(match.pos[1]) - picker.list:move(idx, true) + picker.list:_move(idx, true, true) end, }) end, From e20d9afcbc980510093a3753a3991d8c934cbb75 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 Jan 2025 15:21:01 +0100 Subject: [PATCH 41/78] feat(snacks): extra for snacks explorer (replacement for neo-tree) --- .../plugins/extras/editor/snacks_explorer.lua | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/editor/snacks_explorer.lua diff --git a/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua new file mode 100644 index 00000000..b45342f2 --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua @@ -0,0 +1,37 @@ +return { + { "nvim-neo-tree/neo-tree.nvim", enabled = false }, + { + "folke/snacks.nvim", + keys = { + { + "fe", + function() + Snacks.picker.explorer({ cwd = LazyVim.root() }) + end, + desc = "Explorer Snacks (root dir)", + }, + { + "fE", + function() + Snacks.picker.explorer() + end, + desc = "Explorer Snacks (cwd)", + }, + { "e", "fe", desc = "Explorer Snacks (root dir)", remap = true }, + { "E", "fE", desc = "Explorer Snacks (cwd)", remap = true }, + }, + init = function() + vim.api.nvim_create_autocmd("BufEnter", { + group = vim.api.nvim_create_augroup("snacks_explorer_start_directory", { clear = true }), + desc = "Start Snacks Explorer with directory", + once = true, + callback = function() + local dir = vim.fn.argv(0) --[[@as string]] + if dir ~= "" and vim.fn.isdirectory(dir) == 1 then + Snacks.picker.explorer({ cwd = dir }) + end + end, + }) + end, + }, +} From e9db488acaa04f1a9eca6d022e57fed4271b8af8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 Jan 2025 21:38:56 +0100 Subject: [PATCH 42/78] feat(markdown): added markdown support for codecompanion --- lua/lazyvim/plugins/extras/lang/markdown.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index a73fe114..8b07985b 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -108,7 +108,7 @@ return { enabled = false, }, }, - ft = { "markdown", "norg", "rmd", "org" }, + ft = { "markdown", "norg", "rmd", "org", "codecompanion" }, config = function(_, opts) require("render-markdown").setup(opts) Snacks.toggle({ From 0dee310e90c5cedcb5b96f41acd8d4d3811d15df Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Thu, 30 Jan 2025 20:40:13 +0000 Subject: [PATCH 43/78] 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 ea390859..5c0ff0a2 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 29 +*LazyVim.txt* For Neovim Last change: 2025 January 30 ============================================================================== Table of Contents *LazyVim-table-of-contents* From eb8ddea8c9438c34e71db097eb77a44185dd1093 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:07:58 +0100 Subject: [PATCH 44/78] chore(main): release 14.9.0 (#5438) :robot: I have created a release *beep* *boop* --- ## [14.9.0](https://github.com/LazyVim/LazyVim/compare/v14.8.0...v14.9.0) (2025-01-30) ### Features * **markdown:** added markdown support for codecompanion ([e9db488](https://github.com/LazyVim/LazyVim/commit/e9db488acaa04f1a9eca6d022e57fed4271b8af8)) * **snacks.picker:** added <leader>si to search icons ([#5460](https://github.com/LazyVim/LazyVim/issues/5460)) ([eea52be](https://github.com/LazyVim/LazyVim/commit/eea52be3447502dde77d9e6fa75fd597a0b5a86a)) * **snacks.picker:** added <leader>su to search undotree ([#5447](https://github.com/LazyVim/LazyVim/issues/5447)) ([332b320](https://github.com/LazyVim/LazyVim/commit/332b32080c52727a16db90e06989caa0c378caa1)) * **snacks.picker:** added `leader-fB` to find any buffer (including hidden & nofile) ([83bf636](https://github.com/LazyVim/LazyVim/commit/83bf6360a1f28a3fc1afe31ae300247fc01c7a90)) * **snacks.picker:** added `leader-sp` to search for plugin spec ([7cf4185](https://github.com/LazyVim/LazyVim/commit/7cf4185dc4d1fe49ad004d33a6703603fb4500ff)) * **snacks.picker:** added alt-c to toggle between cwd/root dir ([6be7c4f](https://github.com/LazyVim/LazyVim/commit/6be7c4fee4fb755ff07f7bcc13eac96e1d8c279a)) * **snacks.picker:** flash.nvim integration ([5d24aa6](https://github.com/LazyVim/LazyVim/commit/5d24aa63111af68fbada8c97fedb75b07b8c3c92)) * **snacks.picker:** use snacks picker for notifications when enabled ([01a70cc](https://github.com/LazyVim/LazyVim/commit/01a70cc60ed2760afc819510177fb8d12a371b25)) * **snacks:** extra for snacks explorer (replacement for neo-tree) ([e20d9af](https://github.com/LazyVim/LazyVim/commit/e20d9afcbc980510093a3753a3991d8c934cbb75)) * **snippets:** an extra for mini.snippets ([#5274](https://github.com/LazyVim/LazyVim/issues/5274)) ([8b4e6ff](https://github.com/LazyVim/LazyVim/commit/8b4e6ff70d682cad3b1f4999623c3f0ac639fa82)) ### Bug Fixes * **keymaps:** remove unneeded and ambiguous `<leader>w` keymap ([#5459](https://github.com/LazyVim/LazyVim/issues/5459)) ([132986a](https://github.com/LazyVim/LazyVim/commit/132986a624b49bf740161d90ce94f16dd5ea5883)) * **luasnip:** schedule `jump` to be compatible with blink, nvim-cmp still works after change ([#5470](https://github.com/LazyVim/LazyVim/issues/5470)) ([0350934](https://github.com/LazyVim/LazyVim/commit/0350934d56579f3e6a9d40fa47313b2970d74772)) * **root:** pass args to root.get ([dc8512f](https://github.com/LazyVim/LazyVim/commit/dc8512fce1ec1cd4b0ca52d1077b2ed3894d51c8)) * **snacks.picker:** flash integration ([b5cd0d0](https://github.com/LazyVim/LazyVim/commit/b5cd0d0e27081be3ef1905475a0fe541b7661870)) * **snacks.picker:** snacks => flash ([3de7b24](https://github.com/LazyVim/LazyVim/commit/3de7b24cf6ed844772ea047476a400c56d5f4b42)) * **snacks:** use `Snacks.picker` for recent files ([#5485](https://github.com/LazyVim/LazyVim/issues/5485)) ([f0d2629](https://github.com/LazyVim/LazyVim/commit/f0d2629bd859eeac343999b0fe145f9beb227c4a)) * **sql:** better nvim-cmp check. Closes [#5188](https://github.com/LazyVim/LazyVim/issues/5188) ([1e83b4f](https://github.com/LazyVim/LazyVim/commit/1e83b4f843f88678189df81b1c88a400c53abdbc)) * **vscode:** diabled some snacks plugins. Fixes [#5364](https://github.com/LazyVim/LazyVim/issues/5364) ([c7a7ab5](https://github.com/LazyVim/LazyVim/commit/c7a7ab51129692927ae47f4e57ce22d10d48467e)) --- 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 | 28 +++++++++++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index b3c4f00b..d1d210f5 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "14.8.0" + ".": "14.9.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1057fb57..7c9c762e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [14.9.0](https://github.com/LazyVim/LazyVim/compare/v14.8.0...v14.9.0) (2025-01-30) + + +### Features + +* **markdown:** added markdown support for codecompanion ([e9db488](https://github.com/LazyVim/LazyVim/commit/e9db488acaa04f1a9eca6d022e57fed4271b8af8)) +* **snacks.picker:** added <leader>si to search icons ([#5460](https://github.com/LazyVim/LazyVim/issues/5460)) ([eea52be](https://github.com/LazyVim/LazyVim/commit/eea52be3447502dde77d9e6fa75fd597a0b5a86a)) +* **snacks.picker:** added <leader>su to search undotree ([#5447](https://github.com/LazyVim/LazyVim/issues/5447)) ([332b320](https://github.com/LazyVim/LazyVim/commit/332b32080c52727a16db90e06989caa0c378caa1)) +* **snacks.picker:** added `leader-fB` to find any buffer (including hidden & nofile) ([83bf636](https://github.com/LazyVim/LazyVim/commit/83bf6360a1f28a3fc1afe31ae300247fc01c7a90)) +* **snacks.picker:** added `leader-sp` to search for plugin spec ([7cf4185](https://github.com/LazyVim/LazyVim/commit/7cf4185dc4d1fe49ad004d33a6703603fb4500ff)) +* **snacks.picker:** added alt-c to toggle between cwd/root dir ([6be7c4f](https://github.com/LazyVim/LazyVim/commit/6be7c4fee4fb755ff07f7bcc13eac96e1d8c279a)) +* **snacks.picker:** flash.nvim integration ([5d24aa6](https://github.com/LazyVim/LazyVim/commit/5d24aa63111af68fbada8c97fedb75b07b8c3c92)) +* **snacks.picker:** use snacks picker for notifications when enabled ([01a70cc](https://github.com/LazyVim/LazyVim/commit/01a70cc60ed2760afc819510177fb8d12a371b25)) +* **snacks:** extra for snacks explorer (replacement for neo-tree) ([e20d9af](https://github.com/LazyVim/LazyVim/commit/e20d9afcbc980510093a3753a3991d8c934cbb75)) +* **snippets:** an extra for mini.snippets ([#5274](https://github.com/LazyVim/LazyVim/issues/5274)) ([8b4e6ff](https://github.com/LazyVim/LazyVim/commit/8b4e6ff70d682cad3b1f4999623c3f0ac639fa82)) + + +### Bug Fixes + +* **keymaps:** remove unneeded and ambiguous `<leader>w` keymap ([#5459](https://github.com/LazyVim/LazyVim/issues/5459)) ([132986a](https://github.com/LazyVim/LazyVim/commit/132986a624b49bf740161d90ce94f16dd5ea5883)) +* **luasnip:** schedule `jump` to be compatible with blink, nvim-cmp still works after change ([#5470](https://github.com/LazyVim/LazyVim/issues/5470)) ([0350934](https://github.com/LazyVim/LazyVim/commit/0350934d56579f3e6a9d40fa47313b2970d74772)) +* **root:** pass args to root.get ([dc8512f](https://github.com/LazyVim/LazyVim/commit/dc8512fce1ec1cd4b0ca52d1077b2ed3894d51c8)) +* **snacks.picker:** flash integration ([b5cd0d0](https://github.com/LazyVim/LazyVim/commit/b5cd0d0e27081be3ef1905475a0fe541b7661870)) +* **snacks.picker:** snacks => flash ([3de7b24](https://github.com/LazyVim/LazyVim/commit/3de7b24cf6ed844772ea047476a400c56d5f4b42)) +* **snacks:** use `Snacks.picker` for recent files ([#5485](https://github.com/LazyVim/LazyVim/issues/5485)) ([f0d2629](https://github.com/LazyVim/LazyVim/commit/f0d2629bd859eeac343999b0fe145f9beb227c4a)) +* **sql:** better nvim-cmp check. Closes [#5188](https://github.com/LazyVim/LazyVim/issues/5188) ([1e83b4f](https://github.com/LazyVim/LazyVim/commit/1e83b4f843f88678189df81b1c88a400c53abdbc)) +* **vscode:** diabled some snacks plugins. Fixes [#5364](https://github.com/LazyVim/LazyVim/issues/5364) ([c7a7ab5](https://github.com/LazyVim/LazyVim/commit/c7a7ab51129692927ae47f4e57ce22d10d48467e)) + ## [14.8.0](https://github.com/LazyVim/LazyVim/compare/v14.7.0...v14.8.0) (2025-01-20) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 8a0b2ced..cbe0a571 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 = "14.8.0" -- x-release-please-version +M.version = "14.9.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 4f006f1fba5fdaa0150c544ad7966b96ec9cb04a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 Jan 2025 08:32:46 +0100 Subject: [PATCH 45/78] feat(snacks.explorer): enabled netrw integration --- .../plugins/extras/editor/snacks_explorer.lua | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua index b45342f2..27da61f8 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua @@ -2,6 +2,7 @@ return { { "nvim-neo-tree/neo-tree.nvim", enabled = false }, { "folke/snacks.nvim", + opts = { explorer = {} }, keys = { { "fe", @@ -20,18 +21,5 @@ return { { "e", "fe", desc = "Explorer Snacks (root dir)", remap = true }, { "E", "fE", desc = "Explorer Snacks (cwd)", remap = true }, }, - init = function() - vim.api.nvim_create_autocmd("BufEnter", { - group = vim.api.nvim_create_augroup("snacks_explorer_start_directory", { clear = true }), - desc = "Start Snacks Explorer with directory", - once = true, - callback = function() - local dir = vim.fn.argv(0) --[[@as string]] - if dir ~= "" and vim.fn.isdirectory(dir) == 1 then - Snacks.picker.explorer({ cwd = dir }) - end - end, - }) - end, }, } From 0e94534dd93d4cb53006390e8a7548b9d6fa3146 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 Jan 2025 08:33:15 +0100 Subject: [PATCH 46/78] style(picker.explorer): use shortcut --- lua/lazyvim/plugins/extras/editor/snacks_explorer.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua index 27da61f8..aa87e85c 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua @@ -7,14 +7,14 @@ return { { "fe", function() - Snacks.picker.explorer({ cwd = LazyVim.root() }) + Snacks.explorer({ cwd = LazyVim.root() }) end, desc = "Explorer Snacks (root dir)", }, { "fE", function() - Snacks.picker.explorer() + Snacks.explorer() end, desc = "Explorer Snacks (cwd)", }, From 3242ab8cff7d49e429320b9ec43c4be1f6e46dfe Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Fri, 31 Jan 2025 07:34:07 +0000 Subject: [PATCH 47/78] 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 5c0ff0a2..fa81c82c 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 30 +*LazyVim.txt* For Neovim Last change: 2025 January 31 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 4a81a370d7868d7db32042f69b0fc5a6218059c5 Mon Sep 17 00:00:00 2001 From: abeldekat <58370433+abeldekat@users.noreply.github.com> Date: Fri, 31 Jan 2025 16:11:26 +0000 Subject: [PATCH 48/78] feat(snippets): mini.snippets is out of beta (#5505) ## Description mini.snippets is out of beta, so I adjusted the description for the extra accordingly ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: abeldekat --- lua/lazyvim/plugins/extras/coding/mini-snippets.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/coding/mini-snippets.lua b/lua/lazyvim/plugins/extras/coding/mini-snippets.lua index f68af110..5ce82c80 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-snippets.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-snippets.lua @@ -61,7 +61,7 @@ return { { "L3MON4D3/LuaSnip", optional = true, enabled = false }, -- add mini.snippets - desc = "mini.snippets(beta), a plugin to manage and expand snippets (alternative for luasnip)", + desc = "Manage and expand snippets (alternative to Luasnip)", { "echasnovski/mini.snippets", event = "InsertEnter", -- don't depend on other plugins to load... From 8f4e9b8c1e43e354d91529484aedca54f04bdcf6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 Jan 2025 20:10:48 +0100 Subject: [PATCH 49/78] fix(copilot): remove load on BufReadPost instead of InsertEnter --- lua/lazyvim/plugins/extras/ai/copilot.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/ai/copilot.lua b/lua/lazyvim/plugins/extras/ai/copilot.lua index 4651c689..4f1d54f2 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot.lua @@ -5,11 +5,12 @@ return { "zbirenbaum/copilot.lua", cmd = "Copilot", build = ":Copilot auth", - event = "InsertEnter", + event = "BufReadPost", opts = { suggestion = { enabled = not vim.g.ai_cmp, auto_trigger = true, + hide_during_completion = vim.g.ai_cmp, keymap = { accept = false, -- handled by nvim-cmp / blink.cmp next = "", From 3500d6a826a32d06d921f3e22342734c61ef09fe Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 Jan 2025 20:33:15 +0100 Subject: [PATCH 50/78] feat(bufferline): support for snacks picker sidebars --- lua/lazyvim/plugins/ui.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 6e03a217..7985825a 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -37,6 +37,9 @@ return { highlight = "Directory", text_align = "left", }, + { + filetype = "snacks_layout_box", + }, }, ---@param opts bufferline.IconFetcherOpts get_element_icon = function(opts) From 1a4d948e0dae360836187be8c86283d7e814b7ef Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 2 Feb 2025 18:03:13 +0100 Subject: [PATCH 51/78] perf(snacks_picker): lazy-load trouble open action --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index b6b6deee..9685c369 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -110,7 +110,11 @@ return { if LazyVim.has("trouble.nvim") then return vim.tbl_deep_extend("force", opts or {}, { picker = { - actions = require("trouble.sources.snacks").actions, + actions = { + trouble_open = function(...) + return require("trouble.sources.snacks").actions.trouble_open.action(...) + end, + }, win = { input = { keys = { From 7f8e797d2b0adf1e17a6278957c68a910b01c846 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Sun, 2 Feb 2025 17:04:34 +0000 Subject: [PATCH 52/78] 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 fa81c82c..50d40e8e 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 January 31 +*LazyVim.txt* For Neovim Last change: 2025 February 02 ============================================================================== Table of Contents *LazyVim-table-of-contents* From fb256f2b688cb7ac9875f704fe6c00f27efc2354 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 2 Feb 2025 23:34:05 +0100 Subject: [PATCH 53/78] feat(snacks.picker): add projects picker to dashboard if snacks picker is enabled --- lua/lazyvim/plugins/ui.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 7985825a..0669054d 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -325,4 +325,18 @@ return { }, }, }, + { + "folke/snacks.nvim", + opts = function(_, opts) + if not opts.picker then + return + end + table.insert(opts.dashboard.preset.keys, 3, { + icon = " ", + key = "p", + desc = "Projects", + action = ":lua Snacks.picker.projects()", + }) + end, + }, } From ab304426527723e116742cd7862fc976f876107c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Feb 2025 08:00:58 +0100 Subject: [PATCH 54/78] feat(snacks.picker): some extra keymaps --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 9685c369..143d459a 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -75,6 +75,7 @@ return { { "gc", function() Snacks.picker.git_log() end, desc = "Git Log" }, { "gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" }, { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, + { "gS", function() Snacks.picker.git_stash() end, desc = "Git Stash" }, -- Grep { "sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" }, { "sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" }, @@ -85,10 +86,12 @@ return { { "sW", LazyVim.pick("grep_word", { root = false }), desc = "Visual selection or word (cwd)", mode = { "n", "x" } }, -- search { 's"', function() Snacks.picker.registers() end, desc = "Registers" }, + { 's/', function() Snacks.picker.search_history() end, desc = "Search History" }, { "sa", function() Snacks.picker.autocmds() end, desc = "Autocmds" }, { "sc", function() Snacks.picker.command_history() end, desc = "Command History" }, { "sC", function() Snacks.picker.commands() end, desc = "Commands" }, { "sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, + { "sD", function() Snacks.picker.diagnostics_buffer() end, desc = "Diagnostics" }, { "sh", function() Snacks.picker.help() end, desc = "Help Pages" }, { "sH", function() Snacks.picker.highlights() end, desc = "Highlights" }, { "si", function() Snacks.picker.icons() end, desc = "Icons" }, From 634f3ea28f84ceaac76e8d2a827024e4beeaeaa4 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Wed, 5 Feb 2025 07:02:02 +0000 Subject: [PATCH 55/78] 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 50d40e8e..b645e69e 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 February 02 +*LazyVim.txt* For Neovim Last change: 2025 February 05 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3e8fddcd54ee57ab6c00353ff37a4e9d7df361bd Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Feb 2025 14:41:29 +0100 Subject: [PATCH 56/78] style(snacks.picker): buffer diagnostics keymap desc --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 143d459a..bd160f26 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -91,7 +91,7 @@ return { { "sc", function() Snacks.picker.command_history() end, desc = "Command History" }, { "sC", function() Snacks.picker.commands() end, desc = "Commands" }, { "sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, - { "sD", function() Snacks.picker.diagnostics_buffer() end, desc = "Diagnostics" }, + { "sD", function() Snacks.picker.diagnostics_buffer() end, desc = "Buffer Diagnostics" }, { "sh", function() Snacks.picker.help() end, desc = "Help Pages" }, { "sH", function() Snacks.picker.highlights() end, desc = "Highlights" }, { "si", function() Snacks.picker.icons() end, desc = "Icons" }, From 23a1bbdae90f37aab4a86bfb4c113531a28e7f71 Mon Sep 17 00:00:00 2001 From: RohitB <19793591+rbhanot4739@users.noreply.github.com> Date: Fri, 7 Feb 2025 02:09:37 +0530 Subject: [PATCH 57/78] feat(refactoring): fallback to using vim ui select for refactoring.nvim (#5540) ## Description Fallback to using `require("refactoring").select_refactor()` if neither of `telescope` or `fzf-lua` is installed. Since `select_refactor()` uses `vim.ui.select` internally, it can use `snacks.picker` if it is enabled. ## Related Issue(s) ## Screenshots ## Checklist - [ x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/refactoring.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/refactoring.lua b/lua/lazyvim/plugins/extras/editor/refactoring.lua index 29920347..832940e9 100644 --- a/lua/lazyvim/plugins/extras/editor/refactoring.lua +++ b/lua/lazyvim/plugins/extras/editor/refactoring.lua @@ -1,10 +1,10 @@ local pick = function() + local refactoring = require("refactoring") if LazyVim.pick.picker.name == "telescope" then return require("telescope").extensions.refactoring.refactors() elseif LazyVim.pick.picker.name == "fzf" then local fzf_lua = require("fzf-lua") - local results = require("refactoring").get_refactors() - local refactoring = require("refactoring") + local results = refactoring.get_refactors() local opts = { fzf_opts = {}, @@ -16,6 +16,8 @@ local pick = function() }, } fzf_lua.fzf_exec(results, opts) + else + refactoring.select_refactor() end end From 94d0ac0a0cae69ecdba4aebd062c18fee68ce5f2 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Thu, 6 Feb 2025 20:40:54 +0000 Subject: [PATCH 58/78] 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 b645e69e..f2f14206 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 February 05 +*LazyVim.txt* For Neovim Last change: 2025 February 06 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 5c9732733de62a4e15988826f53d16a4dfdf960c Mon Sep 17 00:00:00 2001 From: cjon256 <3659487+cjon256@users.noreply.github.com> Date: Fri, 7 Feb 2025 18:09:03 -0500 Subject: [PATCH 59/78] fix(go): update go.lua to eliminate fieldalignment from analyses (#5170) ## Description Removed a setting from the go lang plugin. The setting now just causes an error: LSP[gopls] Invalid settings: setting option "analyses": this setting is deprecated, use "the 'fieldalignment' analyzer was removed in gopls/v0.17.0; instead, hover over struct fields to see size/offset information (https://go.dev/issue/66861)" instead ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. Note: submitted similar request as f96aac6 but was rejected by CI/CD for naming reasons. Changing the name did not help. Retrying. --- lua/lazyvim/plugins/extras/lang/go.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index b9544cfd..bf3b22ee 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -37,7 +37,6 @@ return { rangeVariableTypes = true, }, analyses = { - fieldalignment = true, nilness = true, unusedparams = true, unusedwrite = true, From a10706e819b9f40bd3493304be4d75cd69fdf45a Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Fri, 7 Feb 2025 23:10:27 +0000 Subject: [PATCH 60/78] 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 f2f14206..43127781 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 February 06 +*LazyVim.txt* For Neovim Last change: 2025 February 07 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 597cd8ffa3c54471df860c4036a8c20e123292b9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 8 Feb 2025 00:10:47 +0100 Subject: [PATCH 61/78] chore(main): release 14.10.0 (#5500) :robot: I have created a release *beep* *boop* --- ## [14.10.0](https://github.com/LazyVim/LazyVim/compare/v14.9.0...v14.10.0) (2025-02-07) ### Features * **bufferline:** support for snacks picker sidebars ([3500d6a](https://github.com/LazyVim/LazyVim/commit/3500d6a826a32d06d921f3e22342734c61ef09fe)) * **refactoring:** fallback to using vim ui select for refactoring.nvim ([#5540](https://github.com/LazyVim/LazyVim/issues/5540)) ([23a1bbd](https://github.com/LazyVim/LazyVim/commit/23a1bbdae90f37aab4a86bfb4c113531a28e7f71)) * **snacks.explorer:** enabled netrw integration ([4f006f1](https://github.com/LazyVim/LazyVim/commit/4f006f1fba5fdaa0150c544ad7966b96ec9cb04a)) * **snacks.picker:** add projects picker to dashboard if snacks picker is enabled ([fb256f2](https://github.com/LazyVim/LazyVim/commit/fb256f2b688cb7ac9875f704fe6c00f27efc2354)) * **snacks.picker:** some extra keymaps ([ab30442](https://github.com/LazyVim/LazyVim/commit/ab304426527723e116742cd7862fc976f876107c)) * **snippets:** mini.snippets is out of beta ([#5505](https://github.com/LazyVim/LazyVim/issues/5505)) ([4a81a37](https://github.com/LazyVim/LazyVim/commit/4a81a370d7868d7db32042f69b0fc5a6218059c5)) ### Bug Fixes * **copilot:** remove load on BufReadPost instead of InsertEnter ([8f4e9b8](https://github.com/LazyVim/LazyVim/commit/8f4e9b8c1e43e354d91529484aedca54f04bdcf6)) * **go:** update go.lua to eliminate fieldalignment from analyses ([#5170](https://github.com/LazyVim/LazyVim/issues/5170)) ([5c97327](https://github.com/LazyVim/LazyVim/commit/5c9732733de62a4e15988826f53d16a4dfdf960c)) ### Performance Improvements * **snacks_picker:** lazy-load trouble open action ([1a4d948](https://github.com/LazyVim/LazyVim/commit/1a4d948e0dae360836187be8c86283d7e814b7ef)) --- 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 | 23 +++++++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index d1d210f5..8b4f0289 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "14.9.0" + ".": "14.10.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c9c762e..8117fbb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [14.10.0](https://github.com/LazyVim/LazyVim/compare/v14.9.0...v14.10.0) (2025-02-07) + + +### Features + +* **bufferline:** support for snacks picker sidebars ([3500d6a](https://github.com/LazyVim/LazyVim/commit/3500d6a826a32d06d921f3e22342734c61ef09fe)) +* **refactoring:** fallback to using vim ui select for refactoring.nvim ([#5540](https://github.com/LazyVim/LazyVim/issues/5540)) ([23a1bbd](https://github.com/LazyVim/LazyVim/commit/23a1bbdae90f37aab4a86bfb4c113531a28e7f71)) +* **snacks.explorer:** enabled netrw integration ([4f006f1](https://github.com/LazyVim/LazyVim/commit/4f006f1fba5fdaa0150c544ad7966b96ec9cb04a)) +* **snacks.picker:** add projects picker to dashboard if snacks picker is enabled ([fb256f2](https://github.com/LazyVim/LazyVim/commit/fb256f2b688cb7ac9875f704fe6c00f27efc2354)) +* **snacks.picker:** some extra keymaps ([ab30442](https://github.com/LazyVim/LazyVim/commit/ab304426527723e116742cd7862fc976f876107c)) +* **snippets:** mini.snippets is out of beta ([#5505](https://github.com/LazyVim/LazyVim/issues/5505)) ([4a81a37](https://github.com/LazyVim/LazyVim/commit/4a81a370d7868d7db32042f69b0fc5a6218059c5)) + + +### Bug Fixes + +* **copilot:** remove load on BufReadPost instead of InsertEnter ([8f4e9b8](https://github.com/LazyVim/LazyVim/commit/8f4e9b8c1e43e354d91529484aedca54f04bdcf6)) +* **go:** update go.lua to eliminate fieldalignment from analyses ([#5170](https://github.com/LazyVim/LazyVim/issues/5170)) ([5c97327](https://github.com/LazyVim/LazyVim/commit/5c9732733de62a4e15988826f53d16a4dfdf960c)) + + +### Performance Improvements + +* **snacks_picker:** lazy-load trouble open action ([1a4d948](https://github.com/LazyVim/LazyVim/commit/1a4d948e0dae360836187be8c86283d7e814b7ef)) + ## [14.9.0](https://github.com/LazyVim/LazyVim/compare/v14.8.0...v14.9.0) (2025-01-30) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index cbe0a571..e2bf10d9 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 = "14.9.0" -- x-release-please-version +M.version = "14.10.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 83988ea46eccbe20953cd807984d2e89d679aa6e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 8 Feb 2025 12:47:41 +0100 Subject: [PATCH 62/78] feat(config): show a warning when lazy.nvim imports order is incorrect --- lua/lazyvim/config/init.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index e2bf10d9..b826d2db 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -206,6 +206,26 @@ function M.setup(opts) "desc", "vscode", }) + + -- Check lazy.nvim import order + local imports = require("lazy.core.config").spec.modules + local function find(pat, last) + for i = last and #imports or 1, last and 1 or #imports, last and -1 or 1 do + if imports[i]:find(pat) then + return i + end + end + end + local lazyvim_plugins = find("^lazyvim%.plugins$") + local extras = find("^lazyvim%.plugins%.extras%.", true) or lazyvim_plugins + local plugins = find("^plugins$") or math.huge + if lazyvim_plugins ~= 1 or extras > plugins then + vim.notify( + "The order of your `lazy.nvim` imports is incorrect:\n- `lazyvim.plugins` should be first\n- followed by any `lazyvim.plugins.extras`\n- and finally your own `plugins`", + "warn", + { title = "LazyVim" } + ) + end end, }) From 041637673371db7866f8bf00d77fc2fb6cc673c6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 8 Feb 2025 12:48:24 +0100 Subject: [PATCH 63/78] feat(util): `has_extra` now also checks for manual imports in `lazy.lua` --- lua/lazyvim/util/init.lua | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 188544c3..66e6e18b 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -55,12 +55,33 @@ function M.has(plugin) return M.get_plugin(plugin) ~= nil end +--- Checks if the extras is enabled: +--- * If the module was imported +--- * If the module was added by LazyExtras +--- * If the module is in the user's lazy imports ---@param extra string function M.has_extra(extra) local Config = require("lazyvim.config") local modname = "lazyvim.plugins.extras." .. extra - return vim.tbl_contains(require("lazy.core.config").spec.modules, modname) - or vim.tbl_contains(Config.json.data.extras, modname) + local LazyConfig = require("lazy.core.config") + -- check if it was imported already + if vim.tbl_contains(LazyConfig.spec.modules, modname) then + return true + end + -- check if it was added by LazyExtras + if vim.tbl_contains(Config.json.data.extras, modname) then + return true + end + -- check if it's in the imports + local spec = LazyConfig.options.spec + if type(spec) == "table" then + for _, s in ipairs(spec) do + if type(s) == "table" and s.import == modname then + return true + end + end + end + return false end ---@param fn fun() From 525377dee9ac3d19f53e333538e4e85586163ad8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 8 Feb 2025 15:04:46 +0100 Subject: [PATCH 64/78] feat(extras): big rework of default extras --- lua/lazyvim/config/init.lua | 58 +++++++ lua/lazyvim/plugins/coding.lua | 13 -- lua/lazyvim/plugins/editor.lua | 145 ------------------ lua/lazyvim/plugins/extras/editor/fzf.lua | 3 - .../plugins/extras/editor/neo-tree.lua | 128 ++++++++++++++++ .../plugins/extras/editor/snacks_picker.lua | 3 - .../plugins/extras/editor/telescope.lua | 9 -- lua/lazyvim/plugins/extras/lang/sql.lua | 2 +- lua/lazyvim/plugins/xtras.lua | 22 ++- lua/lazyvim/util/extras.lua | 6 +- lua/lazyvim/util/init.lua | 9 -- lua/lazyvim/util/pick.lua | 15 -- lua/lazyvim/util/plugin.lua | 9 ++ 13 files changed, 222 insertions(+), 200 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/editor/neo-tree.lua diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index b826d2db..385d0b13 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -144,8 +144,10 @@ M.json = { extras = {}, ---@type string[] }, } +M.json_loaded = false function M.json.load() + M.json_loaded = true local f = io.open(M.json.path, "r") if f then local data = f:read("*a") @@ -322,6 +324,62 @@ function M.init() M.json.load() end +---@alias LazyVimDefault {name: string, extra: string, enabled?: boolean, origin?: "global" | "default" | "extra" } + +local default_extras ---@type table +function M.get_defaults() + if default_extras then + return default_extras + end + ---@type table + local checks = { + picker = { + { name = "fzf", extra = "editor.fzf" }, + { name = "snacks", extra = "editor.snacks_picker" }, + { name = "telescope", extra = "editor.telescope" }, + }, + cmp = { + { name = "blink.cmp", extra = "coding.blink", enabled = vim.fn.has("nvim-0.10") == 1 }, + { name = "nvim-cmp", extra = "coding.nvim-cmp" }, + }, + explorer = { + { name = "neo-tree", extra = "editor.neo-tree" }, + { name = "snacks", extra = "editor.snacks_explorer" }, + }, + } + default_extras = {} + for name, check in pairs(checks) do + local valid = {} ---@type string[] + for _, extra in ipairs(check) do + if extra.enabled ~= false then + valid[#valid + 1] = extra.name + end + end + local origin = "default" + local use = vim.g["lazyvim_" .. name] + use = vim.tbl_contains(valid, use or "auto") and use or nil + origin = use and "global" or origin + for _, extra in ipairs(use and {} or check) do + if extra.enabled ~= false and LazyVim.has_extra(extra.extra) then + use = extra.name + break + end + end + origin = use and "extra" or origin + use = use or valid[1] + for _, extra in ipairs(check) do + local import = "lazyvim.plugins.extras." .. extra.extra + extra = vim.deepcopy(extra) + extra.enabled = extra.name == use + if extra.enabled then + extra.origin = origin + end + default_extras[import] = extra + end + end + return default_extras +end + setmetatable(M, { __index = function(_, key) if options == nil then diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index adc76177..0e614e48 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -1,17 +1,4 @@ return { - { - import = "lazyvim.plugins.extras.coding.nvim-cmp", - enabled = function() - return LazyVim.cmp_engine() == "nvim-cmp" - end, - }, - { - import = "lazyvim.plugins.extras.coding.blink", - enabled = function() - return LazyVim.cmp_engine() == "blink.cmp" - end, - }, - -- auto pairs { "echasnovski/mini.pairs", diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 95a1f7b9..4aaf3d1f 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -1,131 +1,5 @@ return { - -- file explorer - { - "nvim-neo-tree/neo-tree.nvim", - cmd = "Neotree", - keys = { - { - "fe", - function() - require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() }) - end, - desc = "Explorer NeoTree (Root Dir)", - }, - { - "fE", - function() - require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() }) - end, - desc = "Explorer NeoTree (cwd)", - }, - { "e", "fe", desc = "Explorer NeoTree (Root Dir)", remap = true }, - { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, - { - "ge", - function() - require("neo-tree.command").execute({ source = "git_status", toggle = true }) - end, - desc = "Git Explorer", - }, - { - "be", - function() - require("neo-tree.command").execute({ source = "buffers", toggle = true }) - end, - desc = "Buffer Explorer", - }, - }, - deactivate = function() - vim.cmd([[Neotree close]]) - end, - init = function() - -- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it, - -- because `cwd` is not set up properly. - vim.api.nvim_create_autocmd("BufEnter", { - group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }), - desc = "Start Neo-tree with directory", - once = true, - callback = function() - if package.loaded["neo-tree"] then - return - else - local stats = vim.uv.fs_stat(vim.fn.argv(0)) - if stats and stats.type == "directory" then - require("neo-tree") - end - end - end, - }) - end, - opts = { - sources = { "filesystem", "buffers", "git_status" }, - open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" }, - filesystem = { - bind_to_cwd = false, - follow_current_file = { enabled = true }, - use_libuv_file_watcher = true, - }, - window = { - mappings = { - ["l"] = "open", - ["h"] = "close_node", - [""] = "none", - ["Y"] = { - function(state) - local node = state.tree:get_node() - local path = node:get_id() - vim.fn.setreg("+", path, "c") - end, - desc = "Copy Path to Clipboard", - }, - ["O"] = { - function(state) - require("lazy.util").open(state.tree:get_node().path, { system = true }) - end, - desc = "Open with System Application", - }, - ["P"] = { "toggle_preview", config = { use_float = false } }, - }, - }, - default_component_configs = { - indent = { - with_expanders = true, -- if nil and file nesting is enabled, will enable expanders - expander_collapsed = "", - expander_expanded = "", - expander_highlight = "NeoTreeExpander", - }, - git_status = { - symbols = { - unstaged = "󰄱", - staged = "󰱒", - }, - }, - }, - }, - config = function(_, opts) - local function on_move(data) - Snacks.rename.on_rename_file(data.source, data.destination) - end - - local events = require("neo-tree.events") - opts.event_handlers = opts.event_handlers or {} - vim.list_extend(opts.event_handlers, { - { event = events.FILE_MOVED, handler = on_move }, - { event = events.FILE_RENAMED, handler = on_move }, - }) - require("neo-tree").setup(opts) - vim.api.nvim_create_autocmd("TermClose", { - pattern = "*lazygit", - callback = function() - if package.loaded["neo-tree.sources.git_status"] then - require("neo-tree.sources.git_status").refresh() - end - end, - }) - end, - }, - -- search/replace in multiple files { "MagicDuck/grug-far.nvim", @@ -384,23 +258,4 @@ return { { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, }, }, - - { - import = "lazyvim.plugins.extras.editor.fzf", - enabled = function() - return LazyVim.pick.want() == "fzf" - end, - }, - { - import = "lazyvim.plugins.extras.editor.telescope", - enabled = function() - return LazyVim.pick.want() == "telescope" - end, - }, - { - import = "lazyvim.plugins.extras.editor.snacks_picker", - enabled = function() - return LazyVim.pick.want() == "snacks" - end, - }, } diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index d4cd4093..aa26f6e1 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -286,9 +286,6 @@ return { { "neovim/nvim-lspconfig", opts = function() - if LazyVim.pick.want() ~= "fzf" then - return - end local Keys = require("lazyvim.plugins.lsp.keymaps").get() -- stylua: ignore vim.list_extend(Keys, { diff --git a/lua/lazyvim/plugins/extras/editor/neo-tree.lua b/lua/lazyvim/plugins/extras/editor/neo-tree.lua new file mode 100644 index 00000000..4a3f99bf --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/neo-tree.lua @@ -0,0 +1,128 @@ +return { + + -- file explorer + { + "nvim-neo-tree/neo-tree.nvim", + cmd = "Neotree", + keys = { + { + "fe", + function() + require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() }) + end, + desc = "Explorer NeoTree (Root Dir)", + }, + { + "fE", + function() + require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() }) + end, + desc = "Explorer NeoTree (cwd)", + }, + { "e", "fe", desc = "Explorer NeoTree (Root Dir)", remap = true }, + { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, + { + "ge", + function() + require("neo-tree.command").execute({ source = "git_status", toggle = true }) + end, + desc = "Git Explorer", + }, + { + "be", + function() + require("neo-tree.command").execute({ source = "buffers", toggle = true }) + end, + desc = "Buffer Explorer", + }, + }, + deactivate = function() + vim.cmd([[Neotree close]]) + end, + init = function() + -- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it, + -- because `cwd` is not set up properly. + vim.api.nvim_create_autocmd("BufEnter", { + group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }), + desc = "Start Neo-tree with directory", + once = true, + callback = function() + if package.loaded["neo-tree"] then + return + else + local stats = vim.uv.fs_stat(vim.fn.argv(0)) + if stats and stats.type == "directory" then + require("neo-tree") + end + end + end, + }) + end, + opts = { + sources = { "filesystem", "buffers", "git_status" }, + open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" }, + filesystem = { + bind_to_cwd = false, + follow_current_file = { enabled = true }, + use_libuv_file_watcher = true, + }, + window = { + mappings = { + ["l"] = "open", + ["h"] = "close_node", + [""] = "none", + ["Y"] = { + function(state) + local node = state.tree:get_node() + local path = node:get_id() + vim.fn.setreg("+", path, "c") + end, + desc = "Copy Path to Clipboard", + }, + ["O"] = { + function(state) + require("lazy.util").open(state.tree:get_node().path, { system = true }) + end, + desc = "Open with System Application", + }, + ["P"] = { "toggle_preview", config = { use_float = false } }, + }, + }, + default_component_configs = { + indent = { + with_expanders = true, -- if nil and file nesting is enabled, will enable expanders + expander_collapsed = "", + expander_expanded = "", + expander_highlight = "NeoTreeExpander", + }, + git_status = { + symbols = { + unstaged = "󰄱", + staged = "󰱒", + }, + }, + }, + }, + config = function(_, opts) + local function on_move(data) + Snacks.rename.on_rename_file(data.source, data.destination) + end + + local events = require("neo-tree.events") + opts.event_handlers = opts.event_handlers or {} + vim.list_extend(opts.event_handlers, { + { event = events.FILE_MOVED, handler = on_move }, + { event = events.FILE_RENAMED, handler = on_move }, + }) + require("neo-tree").setup(opts) + vim.api.nvim_create_autocmd("TermClose", { + pattern = "*lazygit", + callback = function() + if package.loaded["neo-tree.sources.git_status"] then + require("neo-tree.sources.git_status").refresh() + end + end, + }) + end, + }, +} diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index bd160f26..d77c0933 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -136,9 +136,6 @@ return { { "neovim/nvim-lspconfig", opts = function() - if LazyVim.pick.want() ~= "snacks" then - return - end local Keys = require("lazyvim.plugins.lsp.keymaps").get() -- stylua: ignore vim.list_extend(Keys, { diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index 55ccaceb..9fdf7e13 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -61,9 +61,6 @@ return { { "nvim-telescope/telescope.nvim", cmd = "Telescope", - enabled = function() - return LazyVim.pick.want() == "telescope" - end, version = false, -- telescope did only one release, so use HEAD for now dependencies = { { @@ -267,9 +264,6 @@ return { { "stevearc/dressing.nvim", lazy = true, - enabled = function() - return LazyVim.pick.want() == "telescope" - end, init = function() ---@diagnostic disable-next-line: duplicate-set-field vim.ui.select = function(...) @@ -287,9 +281,6 @@ return { { "neovim/nvim-lspconfig", opts = function() - if LazyVim.pick.want() ~= "telescope" then - return - end local Keys = require("lazyvim.plugins.lsp.keymaps").get() -- stylua: ignore vim.list_extend(Keys, { diff --git a/lua/lazyvim/plugins/extras/lang/sql.lua b/lua/lazyvim/plugins/extras/lang/sql.lua index 83de5ee1..8e69374c 100644 --- a/lua/lazyvim/plugins/extras/lang/sql.lua +++ b/lua/lazyvim/plugins/extras/lang/sql.lua @@ -48,7 +48,7 @@ return { vim.api.nvim_create_autocmd("FileType", { pattern = sql_ft, callback = function() - if LazyVim.cmp_engine() == "nvim-cmp" then + if LazyVim.has_extra("coding.nvim-cmp") then local cmp = require("cmp") -- global sources diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index ebb0dd89..30cab43f 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -7,6 +7,7 @@ local prios = { ["lazyvim.plugins.extras.lang.typescript"] = 5, ["lazyvim.plugins.extras.coding.blink"] = 5, ["lazyvim.plugins.extras.formatting.prettier"] = 10, + -- default core extra priority is 20 -- default priority is 50 ["lazyvim.plugins.extras.editor.aerial"] = 100, ["lazyvim.plugins.extras.editor.outline"] = 100, @@ -16,8 +17,27 @@ if vim.g.xtras_prios then prios = vim.tbl_deep_extend("force", prios, vim.g.xtras_prios or {}) end +local extras = {} ---@type string[] +local defaults = LazyVim.config.get_defaults() + +-- Add extras from LazyExtras that are not disabled +for _, extra in ipairs(LazyVim.config.json.data.extras) do + local def = defaults[extra] + if not (def and def.enabled == false) then + extras[#extras + 1] = extra + end +end + +-- Add default extras +for name, extra in pairs(defaults) do + if extra.enabled then + prios[name] = prios[name] or 20 + extras[#extras + 1] = name + end +end + ---@type string[] -local extras = LazyVim.dedup(LazyVim.config.json.data.extras) +extras = LazyVim.dedup(extras) local version = vim.version() local v = version.major .. "_" .. version.minor diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index bd5ca4f3..4984bf54 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -248,6 +248,9 @@ end ---@param extra LazyExtra function X:extra(extra) + local defaults = LazyVim.config.get_defaults() + local def = defaults[extra.module] + local origin = def and (def.origin or "user") or nil if not extra.managed then ---@type LazyExtra[] local parents = {} @@ -263,11 +266,12 @@ function X:extra(extra) self:diagnostic({ message = "Required by " .. table.concat(pp, ", "), }) - elseif vim.tbl_contains(LazyVim.plugin.core_imports, extra.module) then + elseif vim.tbl_contains(LazyVim.plugin.core_imports, extra.module) or origin == "default" then self:diagnostic({ message = "This extra is included by default", }) else + dd(origin) self:diagnostic({ message = "Not managed by LazyExtras (config)", severity = vim.diagnostic.severity.WARN, diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 66e6e18b..4b49f539 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -286,13 +286,4 @@ function M.memoize(fn) end end ----@return "nvim-cmp" | "blink.cmp" -function M.cmp_engine() - vim.g.lazyvim_cmp = vim.g.lazyvim_cmp or "auto" - if vim.g.lazyvim_cmp == "auto" then - return LazyVim.has_extra("coding.nvim-cmp") and "nvim-cmp" or "blink.cmp" - end - return vim.g.lazyvim_cmp -end - return M diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index 2736d7a5..e07150d1 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -28,10 +28,6 @@ function M.register(picker) return true end - if M.picker and M.picker.name ~= M.want() then - M.picker = nil - end - if M.picker and M.picker.name ~= picker.name then LazyVim.warn( "`LazyVim.pick`: picker already set to `" .. M.picker.name .. "`,\nignoring new picker `" .. picker.name .. "`" @@ -42,17 +38,6 @@ function M.register(picker) return true end ----@return "telescope" | "fzf" | "snacks" -function M.want() - vim.g.lazyvim_picker = vim.g.lazyvim_picker or "auto" - if vim.g.lazyvim_picker == "auto" then - return LazyVim.has_extra("editor.snacks_picker") and "snacks" - or LazyVim.has_extra("editor.telescope") and "telescope" - or "fzf" - end - return vim.g.lazyvim_picker -end - ---@param command? string ---@param opts? lazyvim.util.pick.Opts function M.open(command, opts) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index f4a933e9..5d9249fc 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -79,7 +79,16 @@ function M.lazy_file() end function M.fix_imports() + local defaults ---@type table Plugin.Spec.import = LazyVim.inject.args(Plugin.Spec.import, function(_, spec) + if LazyVim.config.json_loaded then + -- extra disabled by defaults? + defaults = defaults or LazyVim.config.get_defaults() + local def = defaults[spec.import] + if def and def.enabled == false then + return false + end + end local dep = M.deprecated_extras[spec and spec.import] if dep then dep = dep .. "\n" .. "Please remove the extra from `lazyvim.json` to hide this warning." From d6829fb82cb2df7970d8312c2ed74d235b5760b9 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Sat, 8 Feb 2025 14:05:52 +0000 Subject: [PATCH 65/78] 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 43127781..496f9713 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 February 07 +*LazyVim.txt* For Neovim Last change: 2025 February 08 ============================================================================== Table of Contents *LazyVim-table-of-contents* From b4c24a3fe882c21555e60a1ec44087526e856eb9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 8 Feb 2025 15:06:56 +0100 Subject: [PATCH 66/78] fix(extras): remove debug --- lua/lazyvim/util/extras.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index 4984bf54..fa87e820 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -271,7 +271,6 @@ function X:extra(extra) message = "This extra is included by default", }) else - dd(origin) self:diagnostic({ message = "Not managed by LazyExtras (config)", severity = vim.diagnostic.severity.WARN, From 25d90b54a3b1863cb4428fd309ab855732289710 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 8 Feb 2025 15:23:30 +0100 Subject: [PATCH 67/78] feat(defaults): new installs now default to snacks picker/explorer. Existing installs don't change. --- lua/lazyvim/config/init.lua | 22 ++++++++++++++++------ lua/lazyvim/util/json.lua | 2 ++ lua/lazyvim/util/plugin.lua | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 385d0b13..e585dd70 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -136,18 +136,19 @@ local defaults = { } M.json = { - version = 7, + version = 8, + loaded = false, path = vim.g.lazyvim_json or vim.fn.stdpath("config") .. "/lazyvim.json", data = { - version = nil, ---@type string? + version = nil, ---@type number? + install_version = nil, ---@type number? news = {}, ---@type table extras = {}, ---@type string[] }, } -M.json_loaded = false function M.json.load() - M.json_loaded = true + M.json.loaded = true local f = io.open(M.json.path, "r") if f then local data = f:read("*a") @@ -159,6 +160,8 @@ function M.json.load() LazyVim.json.migrate() end end + else + M.json.data.install_version = M.json.version end end @@ -334,8 +337,8 @@ function M.get_defaults() ---@type table local checks = { picker = { - { name = "fzf", extra = "editor.fzf" }, { name = "snacks", extra = "editor.snacks_picker" }, + { name = "fzf", extra = "editor.fzf" }, { name = "telescope", extra = "editor.telescope" }, }, cmp = { @@ -343,10 +346,17 @@ function M.get_defaults() { name = "nvim-cmp", extra = "coding.nvim-cmp" }, }, explorer = { - { name = "neo-tree", extra = "editor.neo-tree" }, { name = "snacks", extra = "editor.snacks_explorer" }, + { name = "neo-tree", extra = "editor.neo-tree" }, }, } + + -- existing installs keep their defaults + if (LazyVim.config.json.data.install_version or 7) < 8 then + table.insert(checks.picker, 1, table.remove(checks.picker, 2)) + table.insert(checks.explorer, 1, table.remove(checks.explorer, 2)) + end + default_extras = {} for name, check in pairs(checks) do local valid = {} ---@type string[] diff --git a/lua/lazyvim/util/json.lua b/lua/lazyvim/util/json.lua index f3ca7fcf..ad843687 100644 --- a/lua/lazyvim/util/json.lua +++ b/lua/lazyvim/util/json.lua @@ -97,6 +97,8 @@ function M.migrate() return vim.tbl_contains(ai, name) and ("lazyvim.plugins.extras.ai." .. name) or extra end) end, json.data.extras or {}) + elseif json.data.version == 7 then + json.data.install_version = 7 end M.save() diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 5d9249fc..c20a0fc8 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -81,7 +81,7 @@ end function M.fix_imports() local defaults ---@type table Plugin.Spec.import = LazyVim.inject.args(Plugin.Spec.import, function(_, spec) - if LazyVim.config.json_loaded then + if LazyVim.config.json.loaded then -- extra disabled by defaults? defaults = defaults or LazyVim.config.get_defaults() local def = defaults[spec.import] From 2d6b49281d2550222be6aada0b7eeca07bb26e10 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 8 Feb 2025 15:25:10 +0100 Subject: [PATCH 68/78] fix(snacks.explorer): no longer needed to disable neo-tree --- lua/lazyvim/plugins/extras/editor/snacks_explorer.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua index aa87e85c..3e91f3ea 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua @@ -1,5 +1,4 @@ return { - { "nvim-neo-tree/neo-tree.nvim", enabled = false }, { "folke/snacks.nvim", opts = { explorer = {} }, From 2b3bcf36b2392bef94afefc07e2fcf32960960d7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 8 Feb 2025 15:27:20 +0100 Subject: [PATCH 69/78] fix(snacks.picker): move dashboard shortcut to picker extra. Closes #5549 --- .../plugins/extras/editor/snacks_picker.lua | 11 +++++++++++ lua/lazyvim/plugins/ui.lua | 14 -------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index d77c0933..e929ad50 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -157,6 +157,17 @@ return { { "sT", function () Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, }, }, + { + "folke/snacks.nvim", + opts = function(_, opts) + table.insert(opts.dashboard.preset.keys, 3, { + icon = " ", + key = "p", + desc = "Projects", + action = ":lua Snacks.picker.projects()", + }) + end, + }, { "folke/flash.nvim", optional = true, diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 0669054d..7985825a 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -325,18 +325,4 @@ return { }, }, }, - { - "folke/snacks.nvim", - opts = function(_, opts) - if not opts.picker then - return - end - table.insert(opts.dashboard.preset.keys, 3, { - icon = " ", - key = "p", - desc = "Projects", - action = ":lua Snacks.picker.projects()", - }) - end, - }, } From 29829f7eb6e937f9fe43e9455e55704b3fac8794 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 8 Feb 2025 15:37:13 +0100 Subject: [PATCH 70/78] chore(main): release 14.11.0 (#5550) :robot: I have created a release *beep* *boop* --- ## [14.11.0](https://github.com/LazyVim/LazyVim/compare/v14.10.0...v14.11.0) (2025-02-08) ### Features * **config:** show a warning when lazy.nvim imports order is incorrect ([83988ea](https://github.com/LazyVim/LazyVim/commit/83988ea46eccbe20953cd807984d2e89d679aa6e)) * **defaults:** new installs now default to snacks picker/explorer. Existing installs don't change. ([25d90b5](https://github.com/LazyVim/LazyVim/commit/25d90b54a3b1863cb4428fd309ab855732289710)) * **extras:** big rework of default extras ([525377d](https://github.com/LazyVim/LazyVim/commit/525377dee9ac3d19f53e333538e4e85586163ad8)) * **util:** `has_extra` now also checks for manual imports in `lazy.lua` ([0416376](https://github.com/LazyVim/LazyVim/commit/041637673371db7866f8bf00d77fc2fb6cc673c6)) ### Bug Fixes * **extras:** remove debug ([b4c24a3](https://github.com/LazyVim/LazyVim/commit/b4c24a3fe882c21555e60a1ec44087526e856eb9)) * **snacks.explorer:** no longer needed to disable neo-tree ([2d6b492](https://github.com/LazyVim/LazyVim/commit/2d6b49281d2550222be6aada0b7eeca07bb26e10)) * **snacks.picker:** move dashboard shortcut to picker extra. Closes [#5549](https://github.com/LazyVim/LazyVim/issues/5549) ([2b3bcf3](https://github.com/LazyVim/LazyVim/commit/2b3bcf36b2392bef94afefc07e2fcf32960960d7)) --- 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 | 17 +++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 8b4f0289..c36e41c8 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "14.10.0" + ".": "14.11.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 8117fbb6..06ba397f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [14.11.0](https://github.com/LazyVim/LazyVim/compare/v14.10.0...v14.11.0) (2025-02-08) + + +### Features + +* **config:** show a warning when lazy.nvim imports order is incorrect ([83988ea](https://github.com/LazyVim/LazyVim/commit/83988ea46eccbe20953cd807984d2e89d679aa6e)) +* **defaults:** new installs now default to snacks picker/explorer. Existing installs don't change. ([25d90b5](https://github.com/LazyVim/LazyVim/commit/25d90b54a3b1863cb4428fd309ab855732289710)) +* **extras:** big rework of default extras ([525377d](https://github.com/LazyVim/LazyVim/commit/525377dee9ac3d19f53e333538e4e85586163ad8)) +* **util:** `has_extra` now also checks for manual imports in `lazy.lua` ([0416376](https://github.com/LazyVim/LazyVim/commit/041637673371db7866f8bf00d77fc2fb6cc673c6)) + + +### Bug Fixes + +* **extras:** remove debug ([b4c24a3](https://github.com/LazyVim/LazyVim/commit/b4c24a3fe882c21555e60a1ec44087526e856eb9)) +* **snacks.explorer:** no longer needed to disable neo-tree ([2d6b492](https://github.com/LazyVim/LazyVim/commit/2d6b49281d2550222be6aada0b7eeca07bb26e10)) +* **snacks.picker:** move dashboard shortcut to picker extra. Closes [#5549](https://github.com/LazyVim/LazyVim/issues/5549) ([2b3bcf3](https://github.com/LazyVim/LazyVim/commit/2b3bcf36b2392bef94afefc07e2fcf32960960d7)) + ## [14.10.0](https://github.com/LazyVim/LazyVim/compare/v14.9.0...v14.10.0) (2025-02-07) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index e585dd70..3ec3a62c 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 = "14.10.0" -- x-release-please-version +M.version = "14.11.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 2a608f00d47bb6679a27a313fb0404e4d3a2196c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 8 Feb 2025 18:32:46 +0100 Subject: [PATCH 71/78] fix(copilot-chat): added support for snacks picker. Closes #5432. Closes #5552 --- lua/lazyvim/plugins/extras/ai/copilot-chat.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/copilot-chat.lua b/lua/lazyvim/plugins/extras/ai/copilot-chat.lua index e71f4db1..d67da7b2 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot-chat.lua @@ -9,8 +9,17 @@ function M.pick(kind) LazyVim.warn("No " .. kind .. " found on the current line") return end - local ok = pcall(require, "fzf-lua") - require("CopilotChat.integrations." .. (ok and "fzflua" or "telescope")).pick(items) + local map = { + telescope = "telescope", + fzf = "fzflua", + snacks = "snacks", + } + for _, def in pairs(LazyVim.config.get_defaults()) do + if def.enabled and map[def.name] then + return require("CopilotChat.integrations." .. map[def.name]).pick(items) + end + end + Snacks.notify.error("No picker found") end end From 0bbce1775b7d6750d3c4d761f3ad1bcfb77fb805 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 8 Feb 2025 20:34:17 +0100 Subject: [PATCH 72/78] feat(config): allow disabling the order check with `vim.g.lazyvim_check_order = false` --- lua/lazyvim/config/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 3ec3a62c..42afd66a 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -212,6 +212,10 @@ function M.setup(opts) "vscode", }) + if vim.g.lazyvim_check_order == false then + return + end + -- Check lazy.nvim import order local imports = require("lazy.core.config").spec.modules local function find(pat, last) From da3b5159df326bc31d5a0ebdfa2c5cbbd32df9d2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 10 Feb 2025 12:14:05 +0100 Subject: [PATCH 73/78] feat(config): add option to disable the order check to warning message --- lua/lazyvim/config/init.lua | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 42afd66a..5ef66fd8 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -229,11 +229,18 @@ function M.setup(opts) local extras = find("^lazyvim%.plugins%.extras%.", true) or lazyvim_plugins local plugins = find("^plugins$") or math.huge if lazyvim_plugins ~= 1 or extras > plugins then - vim.notify( - "The order of your `lazy.nvim` imports is incorrect:\n- `lazyvim.plugins` should be first\n- followed by any `lazyvim.plugins.extras`\n- and finally your own `plugins`", - "warn", - { title = "LazyVim" } - ) + local msg = { + "The order of your `lazy.nvim` imports is incorrect:", + "- `lazyvim.plugins` should be first", + "- followed by any `lazyvim.plugins.extras`", + "- and finally your own `plugins`", + "", + "If you think you know what you're doing, you can disable this check with:", + "```lua", + "vim.g.lazyvim_check_order = false", + "```", + } + vim.notify(table.concat(msg, "\n"), "warn", { title = "LazyVim" }) end end, }) From 66981fe5b2c220286a31292fce3cc82b0e17ae76 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:15:22 +0000 Subject: [PATCH 74/78] 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 496f9713..979ab2e6 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 February 08 +*LazyVim.txt* For Neovim Last change: 2025 February 10 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 121a2e27ef0f4d8ab64bf76768b9600c45fd2364 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 10 Feb 2025 23:27:24 +0100 Subject: [PATCH 75/78] fix(extras): disable import handling when loading `:LazyExtras` + changed some recommendations --- .../plugins/extras/coding/mini-surround.lua | 1 - lua/lazyvim/plugins/extras/editor/fzf.lua | 1 - .../plugins/extras/editor/snacks_explorer.lua | 40 +++++++++---------- lua/lazyvim/util/extras.lua | 1 + lua/lazyvim/util/plugin.lua | 3 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/mini-surround.lua b/lua/lazyvim/plugins/extras/coding/mini-surround.lua index 56d16a60..d8ff25c5 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-surround.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-surround.lua @@ -4,7 +4,6 @@ -- and more. return { "echasnovski/mini.surround", - recommended = true, keys = function(_, keys) -- Populate the keys based on the user's options local opts = LazyVim.opts("mini.surround") diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index aa26f6e1..c1dd76fd 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -40,7 +40,6 @@ end return { desc = "Awesome picker for FZF (alternative to Telescope)", - recommended = true, { "ibhagwan/fzf-lua", cmd = "FzfLua", diff --git a/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua index 3e91f3ea..4163c799 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_explorer.lua @@ -1,24 +1,24 @@ return { - { - "folke/snacks.nvim", - opts = { explorer = {} }, - keys = { - { - "fe", - function() - Snacks.explorer({ cwd = LazyVim.root() }) - end, - desc = "Explorer Snacks (root dir)", - }, - { - "fE", - function() - Snacks.explorer() - end, - desc = "Explorer Snacks (cwd)", - }, - { "e", "fe", desc = "Explorer Snacks (root dir)", remap = true }, - { "E", "fE", desc = "Explorer Snacks (cwd)", remap = true }, + desc = "Snacks File Explorer", + recommended = true, + "folke/snacks.nvim", + opts = { explorer = {} }, + keys = { + { + "fe", + function() + Snacks.explorer({ cwd = LazyVim.root() }) + end, + desc = "Explorer Snacks (root dir)", }, + { + "fE", + function() + Snacks.explorer() + end, + desc = "Explorer Snacks (cwd)", + }, + { "e", "fe", desc = "Explorer Snacks (root dir)", remap = true }, + { "E", "fE", desc = "Explorer Snacks (cwd)", remap = true }, }, } diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index fa87e820..6bc8eca2 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -83,6 +83,7 @@ end ---@param modname string ---@param source LazyExtraSource function M.get_extra(source, modname) + LazyVim.plugin.handle_defaults = false local enabled = vim.tbl_contains(M.state, modname) local spec = Plugin.Spec.new(nil, { optional = true, pkg = false }) spec:parse({ import = modname }) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index c20a0fc8..e6cae997 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -5,6 +5,7 @@ local M = {} ---@type string[] M.core_imports = {} +M.handle_defaults = true M.lazy_file_events = { "BufReadPost", "BufNewFile", "BufWritePre" } @@ -81,7 +82,7 @@ end function M.fix_imports() local defaults ---@type table Plugin.Spec.import = LazyVim.inject.args(Plugin.Spec.import, function(_, spec) - if LazyVim.config.json.loaded then + if M.handle_defaults and LazyVim.config.json.loaded then -- extra disabled by defaults? defaults = defaults or LazyVim.config.get_defaults() local def = defaults[spec.import] From 9d426ed7fc57b285e0a89e011f7a35bd99cdc7f8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 11:53:22 +0100 Subject: [PATCH 76/78] chore(main): release 14.12.0 (#5553) :robot: I have created a release *beep* *boop* --- ## [14.12.0](https://github.com/LazyVim/LazyVim/compare/v14.11.0...v14.12.0) (2025-02-10) ### Features * **config:** add option to disable the order check to warning message ([da3b515](https://github.com/LazyVim/LazyVim/commit/da3b5159df326bc31d5a0ebdfa2c5cbbd32df9d2)) * **config:** allow disabling the order check with `vim.g.lazyvim_check_order = false` ([0bbce17](https://github.com/LazyVim/LazyVim/commit/0bbce1775b7d6750d3c4d761f3ad1bcfb77fb805)) ### Bug Fixes * **copilot-chat:** added support for snacks picker. Closes [#5432](https://github.com/LazyVim/LazyVim/issues/5432). Closes [#5552](https://github.com/LazyVim/LazyVim/issues/5552) ([2a608f0](https://github.com/LazyVim/LazyVim/commit/2a608f00d47bb6679a27a313fb0404e4d3a2196c)) * **extras:** disable import handling when loading `:LazyExtras` + changed some recommendations ([121a2e2](https://github.com/LazyVim/LazyVim/commit/121a2e27ef0f4d8ab64bf76768b9600c45fd2364)) --- 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 c36e41c8..88facebb 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "14.11.0" + ".": "14.12.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 06ba397f..2b7c403b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [14.12.0](https://github.com/LazyVim/LazyVim/compare/v14.11.0...v14.12.0) (2025-02-10) + + +### Features + +* **config:** add option to disable the order check to warning message ([da3b515](https://github.com/LazyVim/LazyVim/commit/da3b5159df326bc31d5a0ebdfa2c5cbbd32df9d2)) +* **config:** allow disabling the order check with `vim.g.lazyvim_check_order = false` ([0bbce17](https://github.com/LazyVim/LazyVim/commit/0bbce1775b7d6750d3c4d761f3ad1bcfb77fb805)) + + +### Bug Fixes + +* **copilot-chat:** added support for snacks picker. Closes [#5432](https://github.com/LazyVim/LazyVim/issues/5432). Closes [#5552](https://github.com/LazyVim/LazyVim/issues/5552) ([2a608f0](https://github.com/LazyVim/LazyVim/commit/2a608f00d47bb6679a27a313fb0404e4d3a2196c)) +* **extras:** disable import handling when loading `:LazyExtras` + changed some recommendations ([121a2e2](https://github.com/LazyVim/LazyVim/commit/121a2e27ef0f4d8ab64bf76768b9600c45fd2364)) + ## [14.11.0](https://github.com/LazyVim/LazyVim/compare/v14.10.0...v14.11.0) (2025-02-08) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 5ef66fd8..521cb808 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 = "14.11.0" -- x-release-please-version +M.version = "14.12.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 7fe0b47f177d1f47dd43dd44d9f267c4421a3684 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:54:30 +0000 Subject: [PATCH 77/78] 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 979ab2e6..6a579c49 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 February 10 +*LazyVim.txt* For Neovim Last change: 2025 February 11 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 75297733710951e81b505d88b2d728a5b0a9b6ab Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Feb 2025 14:00:01 +0100 Subject: [PATCH 78/78] feat(lsp): use lsp_config picker instead of `LspInfo` --- lua/lazyvim/plugins/lsp/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 1b62a911..318ec911 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -13,7 +13,7 @@ function M.get() end -- stylua: ignore M._keys = { - { "cl", "LspInfo", desc = "Lsp Info" }, + { "cl", function() Snacks.picker.lsp_config() end, 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" },