You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--config is executed when the plugin loads. The default implementation will automatically run require(MAIN).setup(opts) if opts or config = true is set.
86
-
config=function()
87
-
...
58
+
config=function(_, opts)
59
+
vim.o.undofile=true
60
+
require('fundo').setup(opts)
88
61
end,
89
62
}
90
63
```
91
64
92
-
### Configurations
65
+
#### Commands
66
+
67
+
zpack provides the following commands (default prefix: `Z`, customizable via `cmd_prefix` option):
68
+
69
+
-`:ZUpdate [plugin]` - Update all plugins, or a specific plugin if provided (supports tab completion). See `:h vim.pack.update()`
70
+
-`:ZClean` - Remove plugins that are no longer in your spec
71
+
-`:ZBuild[!] [plugin]` - Run build hook for a specific plugin, or all plugins with `!` (supports tab completion)
72
+
-`:ZLoad[!] [plugin]` - Load a specific unloaded plugin, or all unloaded plugins with `!` (supports tab completion)
73
+
-`:ZDelete[!] [plugin]` - Remove a specific plugin, or all plugins with `!` (supports tab completion)
74
+
- Deleting active plugins in your spec can result in errors in your current session. Restart Neovim to re-install them.
75
+
76
+
77
+
#### Configurations
93
78
94
79
```lua
95
80
require('zpack').setup({
@@ -107,7 +92,7 @@ require('zpack').setup({
107
92
108
93
Plugin-level settings always take precedence over `defaults`.
109
94
110
-
### Importing Specs
95
+
####Importing Specs
111
96
112
97
```lua
113
98
-- automatically import specs from `./lua/plugins/`
@@ -167,6 +152,30 @@ For more examples, refer to example config:
167
152
-[zpack installation and setup](https://github.com/zuqini/nvim/blob/main/init.lua)
When you need custom configuration logic, use a `config` function. The resolved `opts` table is passed as the second argument:
316
-
317
-
```lua
318
-
return {
319
-
'nvim-lualine/lualine.nvim',
320
-
opts= { theme='tokyonight' },
321
-
config=function(_, opts)
322
-
opts.sections= { lualine_a= { 'mode' } }
323
-
require('lualine').setup(opts)
324
-
end,
325
-
}
326
-
```
327
-
328
320
#### Using Plugin Data in Hooks
329
321
330
322
All lifecycle hooks (`init`, `config`, `build`, `cond`) and lazy-loading triggers (`event`, `cmd`, `keys`, `ft`) can be functions that receive a `zpack.Plugin` object containing the resolved plugin path and spec:
@@ -348,7 +340,7 @@ If automatic module detection fails, specify the module explicitly with `main`:
0 commit comments