File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 13
13
* [ Installation] ( #installation )
14
14
* [ Setup nvim-plug] ( #setup-nvim-plug )
15
15
* [ Add plugins] ( #add-plugins )
16
+ * [ ` import ` option] ( #import-option )
16
17
* [ Self upgrade] ( #self-upgrade )
17
18
* [ Plugin Spec] ( #plugin-spec )
18
19
* [ Commands] ( #commands )
@@ -134,6 +135,12 @@ require('plug').add({
134
135
})
135
136
```
136
137
138
+ ### ` import ` option
139
+
140
+ The default ` import ` option is ` plugins ` which means nvim-plug will load ` PluginSpec ` automatically from ` plugins ` directory im runtimepath.
141
+
142
+ To use this option, you need to call ` plug.load() ` function.
143
+
137
144
### Self upgrade
138
145
139
146
you can use nvim-plug to manager nvim-plug:
@@ -373,7 +380,6 @@ Love this plugin? Follow [me](https://wsdjeg.net/) on
373
380
[ GitHub] ( https://github.com/wsdjeg ) and
374
381
[ Twitter] ( http://twitter.com/wsdtty ) .
375
382
376
-
377
383
## Feedback
378
384
379
385
If you encounter any bugs or have suggestions, please file an issue in the [ issue tracker] ( https://github.com/wsdjeg/nvim-plug/issues ) .
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ M.max_processes = 5
13
13
M .base_url = ' https://github.com'
14
14
M .ui = ' default'
15
15
M .clone_depth = ' 1'
16
+ M .import = ' plugins'
16
17
M .enable_priority = false
17
18
function M .setup (opt )
18
19
M .bundle_dir = opt .bundle_dir or M .bundle_dir
Original file line number Diff line number Diff line change @@ -85,6 +85,16 @@ function M.load()
85
85
loader .load (v )
86
86
end
87
87
end
88
+ if config .import then
89
+ for _ , v in ipairs (vim .api .nvim_get_runtime_file (config .import .. ' *.lua' , true )) do
90
+ local plug = assert (loadfile (v ))() --- @type any ?
91
+ if type (plug ) == ' table' and type (plug [1 ]) == ' string' then
92
+ M .add ({ plug })
93
+ elseif type (plug ) == ' table' and type (plug [1 ]) == ' table' then
94
+ M .add (plug )
95
+ end
96
+ end
97
+ end
88
98
end
89
99
90
100
return M
You can’t perform that action at this time.
0 commit comments