Skip to content

Getting error when having multiple config with the same file #1018

Answered by abeldekat
RayZ0rr asked this question in Q&A
Discussion options

You must be logged in to vote

Lazy.nvim will load a plugin on require.

In your setup, I think the following happens:

  • Loading nvim-colorizer requires misc,
  • misc also contains a require on specs.nvim, triggering specs.nvim to load
  • the config function of specs.nvim requires misc again

You could refactor the misc module to contain dedicated functions, which can be called from the config functions in the spec. As a benefit, the pcalls are not needed anymore.

You can also use the import functionality of lazy.nvim. The misc module could just return a list of specs. See LazyVim for inspiration.

Best regards!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@RayZ0rr
Comment options

@abeldekat
Comment options

Answer selected by RayZ0rr
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