From 9c1a2b810adfbb34c3f9c1960007d5b414645af5 Mon Sep 17 00:00:00 2001 From: saccarosium Date: Mon, 26 Dec 2022 16:32:33 +0100 Subject: [PATCH 1/3] feat: opt in setup function as default plugin location instead of start --- lua/paq.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/paq.lua b/lua/paq.lua index 298d449..58d809e 100644 --- a/lua/paq.lua +++ b/lua/paq.lua @@ -1,6 +1,7 @@ local uv = vim.loop local cfg = { path = vim.fn.stdpath("data") .. "/site/pack/paqs/", + opt = false, verbose = false, } local logpath = vim.fn.has("nvim-0.8") == 1 and vim.fn.stdpath("log") or vim.fn.stdpath("cache") @@ -276,6 +277,9 @@ local function register(args) elseif packages[name] then return end + if (args.opt == nil or args.opt) and cfg.opt then + args.opt = true + end local dir = cfg.path .. (args.opt and "opt/" or "start/") .. name packages[name] = { name = name, From 6044f308351b3aba42f0529b76fd68710d3b848f Mon Sep 17 00:00:00 2001 From: saccarosium Date: Mon, 26 Dec 2022 16:40:46 +0100 Subject: [PATCH 2/3] Add docs for 'opt' value in setup method --- doc/paq-nvim.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/paq-nvim.txt b/doc/paq-nvim.txt index 8222062..765e8ac 100644 --- a/doc/paq-nvim.txt +++ b/doc/paq-nvim.txt @@ -163,6 +163,13 @@ imported as `paq`, the functions are: Default value: |paq-dir| + `opt` + Boolean that changes if, by default, plugins are eagerly loaded or lazy + loaded. If set, the package will be in the optional packages + directory. See |packages| and |packadd|. + + Default value: `false` + `verbose` Boolean that determines whether paq should print `(up-to-date) pkg` for packages that were not updated. @@ -306,7 +313,7 @@ PAQ AUTOCOMMANDS *paq-autocommands* Paq provides |User| events for its async operations, each event has the name `PaqDone` followed by the name of an operation: - + `PaqDoneInstall` run after `PaqInstall` `PaqDoneUpdate` runs after `PaqUpdate` `PaqDoneSync` runs after `PaqSync` From f4bd02347371a60120e4ec217955923edbf2ac0f Mon Sep 17 00:00:00 2001 From: saccarosium Date: Wed, 4 Jan 2023 00:51:13 +0100 Subject: [PATCH 3/3] fix #132: simplify code --- lua/paq.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lua/paq.lua b/lua/paq.lua index 58d809e..6388d1b 100644 --- a/lua/paq.lua +++ b/lua/paq.lua @@ -277,10 +277,8 @@ local function register(args) elseif packages[name] then return end - if (args.opt == nil or args.opt) and cfg.opt then - args.opt = true - end - local dir = cfg.path .. (args.opt and "opt/" or "start/") .. name + local opt = (args.opt == nil or args.opt) and cfg.opt + local dir = cfg.path .. (opt and "opt/" or "start/") .. name packages[name] = { name = name, branch = args.branch,