Skip to main content

📦 Packages

lazy.nvim supports three ways for plugins to define their dependencies and configuration.

  • Lazy: lazy.lua file
  • Rockspec: luarocks *-scm-1.rockspec file
  • Packspec: pkg.json (experimental, since the format is not quite there yet)

You can enable/disable package sources with config.pkg.sources. The order of sources is important, as the first source that finds a package will be used.

info

Package specs are always loaded in the scope of the plugin (using specs), so that when the plugin is disabled, none of the specs are loaded.

Lazy

Using a lazy.lua file is the recommended way to define your plugin dependencies and configuration. Syntax is the same as any plugin spec.

Rockspec

When a plugin contains a *-1.rockspec file, lazy.nvim will automatically build the rock and its dependencies.

A rockspec will only be used if one of the following is true:

  • the package does not have a /lua directory
  • the package has a complex build step
  • the package has dependencies (excluding lua)

Packspec

Supports the pkg.json format, with a lazy extension in lazy. lazy can contain any valid lazy spec fields. They will be added to the plugin's spec.