Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: opt in setup function as default plugin location instead of start (#131) #132

Merged
merged 3 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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