Skip to content
Discussion options

You must be logged in to vote

So, require("lzextras").mod_dir_to_spec("lazy") will make a list of specs.

You can put it in an import spec, or just pass it straight to lze.load

In that list of specs, it will create 1 import spec for each *.lua file in the lua/lazy directory.

It will also make an entry for each directory with an init.lua in it.

So, to import a subfolder, make the lua/lazy/yourfolder/init.lua return specs from another call to mod_dir_to_spec (and use its filter functionality to not include that "init" file in that list)

So, in the scenario where you do

require("lze").load(require("lzextras").mod_dir_to_spec("lazy"))

lua/lazy/cmp/init.lua would look like

return mod_dir_to_spec(..., function(name) return name

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BirdeeHub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants