Skip to content

Commit b331e1d

Browse files
committed
docs: clarify config and opts relationship in examples
1 parent a4471ba commit b331e1d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ return {
8181
keys = {
8282
{ '<leader>ff', function() require('telescope.builtin').find_files() end, desc = 'Find files' },
8383
},
84-
opts = {}, -- automatically calls require(MAIN).setup(opts) when defined
84+
opts = {},
85+
-- 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+
...
88+
end,
8589
}
8690
```
8791

doc/zpack.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ Each file returns a spec or list of specs (see |zpack-examples| or
120120
desc = 'Find files' },
121121
},
122122
opts = {},
123+
-- config is executed when the plugin loads.
124+
-- The default implementation will automatically run
125+
-- require(MAIN).setup(opts) if opts or config = true is set.
126+
config = function()
127+
...
128+
end,
123129
}
124130
<
125131

0 commit comments

Comments
 (0)