Skip to content

Commit

Permalink
feat: opt in setup function as default plugin location instead of sta…
Browse files Browse the repository at this point in the history
…rt (#132)
  • Loading branch information
saccarosium authored Jan 4, 2023
1 parent 0ed94d5 commit 07407b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion doc/paq-nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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`
Expand Down
4 changes: 3 additions & 1 deletion lua/paq.lua
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -276,7 +277,8 @@ local function register(args)
elseif packages[name] then
return
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,
Expand Down

0 comments on commit 07407b2

Please sign in to comment.