From 47d4baafcc370f16c195fd718f37f8fb1e0aa9a1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 19 Jan 2024 16:09:28 +0100 Subject: [PATCH 01/11] fix(fs): error when plugin directory to delete is not a valid directory --- lua/lazy/manage/task/fs.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazy/manage/task/fs.lua b/lua/lazy/manage/task/fs.lua index 525997e..c753143 100644 --- a/lua/lazy/manage/task/fs.lua +++ b/lua/lazy/manage/task/fs.lua @@ -13,7 +13,7 @@ M.clean = { assert(dir:find(Config.options.root, 1, true) == 1, self.plugin.dir .. " should be under packpath!") local stat = vim.loop.fs_lstat(dir) - assert(stat.type == "directory", self.plugin.dir .. " should be a directory!") + assert(stat and stat.type == "directory", self.plugin.dir .. " should be a directory!") Util.walk(dir, function(path, _, type) if type == "directory" then From 747bb955c5bfb2dc5d51280132f00a56a53f9f6d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 19 Jan 2024 15:10:07 +0000 Subject: [PATCH 02/11] chore(build): auto-generate vimdoc --- doc/lazy.nvim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lazy.nvim.txt b/doc/lazy.nvim.txt index 4c69064..9b9bc16 100644 --- a/doc/lazy.nvim.txt +++ b/doc/lazy.nvim.txt @@ -1,4 +1,4 @@ -*lazy.nvim.txt* For Neovim >= 0.8.0 Last change: 2023 November 04 +*lazy.nvim.txt* For Neovim >= 0.8.0 Last change: 2024 January 19 ============================================================================== Table of Contents *lazy.nvim-table-of-contents* From 5757b551fc6066d836b9e45f70b41561ca619272 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jan 2024 14:11:32 +0100 Subject: [PATCH 03/11] fix(keys): allow global/local ft keymaps to exist at the same time. Fixes #1241 --- lua/lazy/core/handler/keys.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazy/core/handler/keys.lua b/lua/lazy/core/handler/keys.lua index e19d6e5..6ca2c50 100644 --- a/lua/lazy/core/handler/keys.lua +++ b/lua/lazy/core/handler/keys.lua @@ -41,6 +41,11 @@ function M.parse(value, mode) ret.mode = mode or "n" ret.id = vim.api.nvim_replace_termcodes(ret.lhs, true, true, true) + if ret.ft then + local ft = type(ret.ft) == "string" and { ret.ft } or ret.ft --[[@as string[] ]] + ret.id = ret.id .. " (" .. table.concat(ft, ", ") .. ")" + end + if ret.mode ~= "n" then ret.id = ret.id .. " (" .. ret.mode .. ")" end From 42694c4fda37b786670ed2edb7521833954b09ba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 20 Jan 2024 13:12:10 +0000 Subject: [PATCH 04/11] chore(build): auto-generate vimdoc --- doc/lazy.nvim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lazy.nvim.txt b/doc/lazy.nvim.txt index 9b9bc16..1b1b744 100644 --- a/doc/lazy.nvim.txt +++ b/doc/lazy.nvim.txt @@ -1,4 +1,4 @@ -*lazy.nvim.txt* For Neovim >= 0.8.0 Last change: 2024 January 19 +*lazy.nvim.txt* For Neovim >= 0.8.0 Last change: 2024 January 20 ============================================================================== Table of Contents *lazy.nvim-table-of-contents* From a6f782adc1ace840a7e671c731daab7851cba6af Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Sat, 20 Jan 2024 22:19:09 +0900 Subject: [PATCH 05/11] feat(plugin): dev.path can now be a function (#1157) In some case, `dev.path .. plugin.name` is not enoguh. For example, when using `ghq` to manage projects, plugin directories may vary by onewrs of the plugins. With this change, users can do something like below ``` lua require("lazy").setup("plugins", { dev = { path = function(p) -- ghq local path, cnt = string.gsub(p.url, "^https://(.*)%.git$", "~/ghq/%1") if cnt == 1 then return path end -- fallback to default return "~/projects/" .. plugin.name end, }, }) ``` --- README.md | 2 +- lua/lazy/core/config.lua | 6 ++++-- lua/lazy/core/plugin.lua | 15 ++++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ebcca6a..18ade37 100644 --- a/README.md +++ b/README.md @@ -320,7 +320,7 @@ return { filter = true, }, dev = { - -- directory where you store your local plugin projects + ---@type string | fun(plugin: LazyPlugin): string directory where you store your local plugin projects path = "~/projects", ---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub patterns = {}, -- For example {"folke"} diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index 1fbf3ef..90c4206 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -30,7 +30,7 @@ M.defaults = { filter = true, }, dev = { - -- directory where you store your local plugin projects + ---@type string | fun(plugin: LazyPlugin): string directory where you store your local plugin projects path = "~/projects", ---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub patterns = {}, -- For example {"folke"} @@ -213,7 +213,9 @@ function M.setup(opts) table.insert(M.options.install.colorscheme, "habamax") M.options.root = Util.norm(M.options.root) - M.options.dev.path = Util.norm(M.options.dev.path) + if type(M.options.dev.path) == "string" then + M.options.dev.path = Util.norm(M.options.dev.path) + end M.options.lockfile = Util.norm(M.options.lockfile) M.options.readme.root = Util.norm(M.options.readme.root) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index fc25f8d..64c93cd 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -106,11 +106,16 @@ function Spec:add(plugin, results) end -- dev plugins - if - plugin.dev - and (not Config.options.dev.fallback or vim.fn.isdirectory(Config.options.dev.path .. "/" .. plugin.name) == 1) - then - dir = Config.options.dev.path .. "/" .. plugin.name + if plugin.dev then + local dir_dev + if type(Config.options.dev.path) == "string" then + dir_dev = Config.options.dev.path .. "/" .. plugin.name + else + dir_dev = Util.norm(Config.options.dev.path(plugin)) + end + if not Config.options.dev.fallback or vim.fn.isdirectory(dir_dev) == 1 then + dir = dir_dev + end elseif plugin.dev == false then -- explicitely select the default path dir = Config.options.root .. "/" .. plugin.name From 3e0c0a05bdbec315d58c2f181f8dcec04ef6b24d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 20 Jan 2024 13:19:39 +0000 Subject: [PATCH 06/11] chore(build): auto-generate vimdoc --- doc/lazy.nvim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lazy.nvim.txt b/doc/lazy.nvim.txt index 1b1b744..e65b6c8 100644 --- a/doc/lazy.nvim.txt +++ b/doc/lazy.nvim.txt @@ -423,7 +423,7 @@ CONFIGURATION *lazy.nvim-lazy.nvim-configuration* filter = true, }, dev = { - -- directory where you store your local plugin projects + ---@type string | fun(plugin: LazyPlugin): string directory where you store your local plugin projects path = "~/projects", ---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub patterns = {}, -- For example {"folke"} From 1b3df6c00797e1b12f7c16148261e9dd841a33dd Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jan 2024 14:49:47 +0100 Subject: [PATCH 07/11] fix(health): dont warn on submodules. Fixes #1174 --- lua/lazy/health.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazy/health.lua b/lua/lazy/health.lua index 929092d..89feabe 100644 --- a/lua/lazy/health.lua +++ b/lua/lazy/health.lua @@ -131,6 +131,7 @@ M.valid = { "opts", "pin", "priority", + "submodules", "tag", "url", "version", From d0d410bc222a475202d9c2b55d1c5fbd12c26ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Sat, 20 Jan 2024 15:05:26 +0100 Subject: [PATCH 08/11] fix(git): comment sign detection in get_config function (#1281) - Modify the condition in the get_config function to correctly ignore comments and blank lines. - Update the regular expression to exclude lines starting with '#' or ';'. - This change ensures that only valid key-value pairs are added to the configuration table. --- lua/lazy/manage/git.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazy/manage/git.lua b/lua/lazy/manage/git.lua index 98c44b5..6b0ab58 100644 --- a/lua/lazy/manage/git.lua +++ b/lua/lazy/manage/git.lua @@ -217,7 +217,7 @@ function M.get_config(repo) current_section = section:gsub('%s+"', "."):gsub('"+%s*$', "") else -- Ignore comments and blank lines - if not line:match("^%s*#") and line:match("%S") then + if not line:match("^%s*[#;]") and line:match("%S") then local key, value = line:match("^%s*(%S+)%s*=%s*(.+)%s*$") ret[current_section .. "." .. key] = value end From 89e6840d8b921a545724153c2a667624ea7d495b Mon Sep 17 00:00:00 2001 From: Johnny Horvi Date: Sat, 20 Jan 2024 15:08:08 +0100 Subject: [PATCH 09/11] docs: fix typo (#1230) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18ade37..148f0bd 100644 --- a/README.md +++ b/README.md @@ -654,7 +654,7 @@ In practice this means that step 10 of [Neovim Initialization](https://neovim.io 1. All the plugins' `init()` functions are executed 2. All plugins with `lazy=false` are loaded. This includes sourcing `/plugin` and `/ftdetect` files. (`/after` will not be sourced yet) -3. All files from `/plugin` and `/ftdetect` directories in you rtp are sourced (excluding `/after`) +3. All files from `/plugin` and `/ftdetect` directories in your rtp are sourced (excluding `/after`) 4. All `/after/plugin` files are sourced (this includes `/after` from plugins) Files from runtime directories are always sourced in alphabetical order. @@ -824,7 +824,7 @@ To uninstall **lazy.nvim**, you need to remove the following files and directori If your plugin needs a build step, you can create a file `build.lua` or `build/init.lua` in the root of your repo. This file will be loaded when the plugin is installed or updated. -This makes it easier for users, so they no longer need to specify a `build` command. +This makes it easier for users, as they no longer need to specify a `build` command. ## 📦 Other Neovim Plugin Managers in Lua From 0b507680ee5bbc998fdc54a40119de964dbc96cc Mon Sep 17 00:00:00 2001 From: Tomasz Wysocki <121371814+tomaszwysocki@users.noreply.github.com> Date: Sat, 20 Jan 2024 15:08:38 +0100 Subject: [PATCH 10/11] docs: fix typo in README.md (#1226) Corrected a typo in Migration Guide section of the README file. Co-authored-by: Tomasz Wysocki --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 148f0bd..c404f63 100644 --- a/README.md +++ b/README.md @@ -738,8 +738,8 @@ Any other property will override the property from the parent spec. - `lock` ➡️ `pin` - `disable=true` ➡️ `enabled = false` - `tag='*'` ➡️ `version="*"` -- `after` ℹ️ **_not needed_** for most use-cases. Use `dependencies` otherwise. -- `wants` ℹ️ **_not needed_** for most use-cases. Use `dependencies` otherwise. +- `after` is **_not needed_** for most use-cases. Use `dependencies` otherwise. +- `wants` is **_not needed_** for most use-cases. Use `dependencies` otherwise. - `config` don't support string type, use `fun(LazyPlugin)` instead. - `module` is auto-loaded. No need to specify - `keys` spec is [different](#%EF%B8%8F-lazy-key-mappings) From 17d9c93943c692e084dbf203e47e7fa122386d0f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 20 Jan 2024 14:09:14 +0000 Subject: [PATCH 11/11] chore(build): auto-generate vimdoc --- doc/lazy.nvim.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/lazy.nvim.txt b/doc/lazy.nvim.txt index e65b6c8..2fec161 100644 --- a/doc/lazy.nvim.txt +++ b/doc/lazy.nvim.txt @@ -768,7 +768,7 @@ In practice this means that step 10 of |Neovim Initialization| is done by Lazy: 1. All the plugins’ `init()` functions are executed 2. All plugins with `lazy=false` are loaded. This includes sourcing `/plugin` and `/ftdetect` files. (`/after` will not be sourced yet) -3. All files from `/plugin` and `/ftdetect` directories in you rtp are sourced (excluding `/after`) +3. All files from `/plugin` and `/ftdetect` directories in your rtp are sourced (excluding `/after`) 4. All `/after/plugin` files are sourced (this includes `/after` from plugins) Files from runtime directories are always sourced in alphabetical order. @@ -859,8 +859,8 @@ PACKER.NVIM ~ - `lock` `pin` - `disable=true` `enabled = false` - `tag='*'` `version="*"` -- `after` **not needed** for most use-cases. Use `dependencies` otherwise. -- `wants` **not needed** for most use-cases. Use `dependencies` otherwise. +- `after` is **not needed** for most use-cases. Use `dependencies` otherwise. +- `wants` is **not needed** for most use-cases. Use `dependencies` otherwise. - `config` don’t support string type, use `fun(LazyPlugin)` instead. - `module` is auto-loaded. No need to specify - `keys` spec is |lazy.nvim-different| @@ -979,7 +979,7 @@ If your plugin needs a build step, you can create a file `build.lua` or `build/init.lua` in the root of your repo. This file will be loaded when the plugin is installed or updated. -This makes it easier for users, so they no longer need to specify a `build` +This makes it easier for users, as they no longer need to specify a `build` command.