@@ -10,7 +10,6 @@ M.defaults = {
10
10
version = nil ,
11
11
-- version = "*", -- enable this to try installing the latest stable versions of plugins
12
12
},
13
- packpath = vim .fn .stdpath (" data" ) .. " /site/pack/lazy" , -- package path where new plugins will be installed
14
13
lockfile = vim .fn .stdpath (" config" ) .. " /lazy-lock.json" , -- lockfile generated after running update.
15
14
install_missing = true , -- install missing plugins on startup. This doesn't increase startup time.
16
15
concurrency = nil , -- set to a number to limit the maximum amount of concurrent tasks
@@ -20,6 +19,11 @@ M.defaults = {
20
19
log = { " --since=1 days ago" }, -- commits from the last 3 days
21
20
timeout = 120 , -- processes taking over 2 minutes will be killed
22
21
},
22
+ package = {
23
+ path = vim .fn .stdpath (" data" ) .. " /site" ,
24
+ name = " lazy" , -- plugins will be installed under package.path/pack/{name}/opt
25
+ reset = true , -- packpath will be reset to only include lazy. This makes packadd a lot faster
26
+ },
23
27
-- Any plugin spec that contains one of the patterns will use your
24
28
-- local repo in the projects folder instead of fetchig it from github
25
29
-- Mostly useful for plugin developers.
@@ -49,6 +53,8 @@ M.defaults = {
49
53
M .ns = vim .api .nvim_create_namespace (" lazy" )
50
54
51
55
M .paths = {
56
+ --- @type string
57
+ opt = nil ,
52
58
--- @type string
53
59
main = nil ,
54
60
--- @type string
@@ -69,6 +75,11 @@ function M.setup(opts)
69
75
M .options = vim .tbl_deep_extend (" force" , M .defaults , opts or {})
70
76
M .paths .plugins = vim .fn .stdpath (" config" ) .. " /lua/" .. M .options .plugins :gsub (" %." , " /" )
71
77
M .paths .main = M .paths .plugins .. (vim .loop .fs_stat (M .paths .plugins .. " .lua" ) and " .lua" or " /init.lua" )
78
+ M .paths .opt = M .options .package .path .. " /pack/" .. M .options .package .name .. " /opt"
79
+
80
+ if M .options .package .reset then
81
+ vim .go .packpath = M .options .package .path
82
+ end
72
83
73
84
vim .api .nvim_create_autocmd (" User" , {
74
85
pattern = " VeryLazy" ,
0 commit comments