NvChad / starter

Starter config for NvChad
The Unlicense
113 stars 396 forks source link

Not possible to move plugin configs to `plugins/`? #17

Closed SPiCaRiA closed 6 months ago

SPiCaRiA commented 6 months ago

Hi, I'm puzzled that moving plugin configs from lua/configs/ to lua/plugins/ breaks the profile and give me the error like (same error for all other plugin configs, I'm just listing one of them):

Invalid spec module: `plugins.lspconfig`                                                                                                           
Expected a `table` of specs, but a `boolean` was returned instead 

File structure after moving (basically just moving plugin configs to the same folder with plugins/init.lua:

.
├── init.lua
├── lazy-lock.json
├── LICENSE
└── lua/
   ├── chadrc.lua
   ├── configs/
   ├── mappings.lua
   ├── options.lua
   └── plugins/
      ├── cmp.lua
      ├── conform.lua
      ├── init.lua
      ├── lazy.lua
      └── lspconfig.lua

and I changed all the require statements in plugins/init.lua like this:

-- prev
require "configs.lspconfig"
-- now
require "plugins.lspconfig"

And the require statement in init.lua (but I didn't get any error about lazy.nvim's config, only specs of other plugins):

-- prev
local lazy_config = require "configs.lazy"
-- now
local lazy_config = require "plugins.lazy"

Appreciate for any information about how this may come from!

siduck commented 6 months ago

each file in plugins expects a table of plugin definitions in lazy syntax. Please dont move your lazy config into your plugins dir..... You should know how lazy imports work, lazy config is the config for lazy.nvim , its not a lazy spec :/