Skip to content

Commit

Permalink
feat: no need to set opt if a rocks-lazy field is set
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jun 25, 2024
1 parent 7808b24 commit f8785b4
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 140 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/luarocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
version: ${{ env.LUAROCKS_VERSION }}
test_interpreters: ""
dependencies: |
rocks.nvim >= 1.31.0
rocks.nvim >= 1.32.0
lz.n >= 1.2.4
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
## :star2: Summary

`rocks-lazy.nvim` is a rocks.nvim module that helps you lazy-load
your `opt` rocks.nvim plugins
using the [`lz.n`](https://github.com/nvim-neorocks/lz.n) library.
your rocks.nvim plugins using
the [`lz.n`](https://github.com/nvim-neorocks/lz.n) library.

> [!NOTE]
>
Expand Down Expand Up @@ -68,13 +68,6 @@ and you are good to go!
With this module installed, you can add the fields that tell `rocks-lazy.nvim`
how to lazy-load to a `[plugins]` entry in your `rocks.toml`.

> [!IMPORTANT]
>
> Because rocks.nvim currently does not have an API to hook into plugin loading[^1],
> you must set `opt = true` for any plugins you want to lazy-load.
[^1]: This may change as rocks.nvim matures.

#### `event`

Lazy-load on an event (`:h autocmd-events`).
Expand Down Expand Up @@ -155,9 +148,9 @@ Where `rocks.lazy.KeysSpec` is a table with the following fields:
>
> - If unspecified, the default `mode` is `n`.
> - The `lhs` and `rhs` fields differ
> from [the `lz.n.PluginSpec`](https://github.com/nvim-neorocks/lz.n?tab=readme-ov-file#plugin-spec)[^2].
> from [the `lz.n.PluginSpec`](https://github.com/nvim-neorocks/lz.n?tab=readme-ov-file#plugin-spec)[^1].
[^2]: This is because toml tables are stricter than Lua tables.
[^1]: This is because toml tables are stricter than Lua tables.

Examples:

Expand Down Expand Up @@ -222,6 +215,11 @@ colorscheme = [
If you prefer using Lua for configuration,
you can add a `import` option to your `rocks.toml`:
> [!IMPORTANT]
>
> If you use Lua to configure lazy-loading, you must set `opt = true`
> in your rocks.toml entries.
```toml
[rocks_lazy]
import = "lazy_specs/"
Expand Down
Loading

0 comments on commit f8785b4

Please sign in to comment.