Skip to content

Commit

Permalink
feat!: don't load bundles with opt items, add api for loading them
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jul 29, 2024
1 parent 3167c3d commit 1e60d83
Show file tree
Hide file tree
Showing 9 changed files with 411 additions and 142 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,13 @@ a file in `lua/bundles/language_support.lua`.

#### `load_opt_plugins`

By default, `rocks-config.nvim` will not load configs for plugins
with `opt = true` or plugins that have been marked as `opt`, e.g. by rocks-lazy.nvim.
By default, `rocks-config.nvim` will not load configs for

- plugins with `opt = true`
- or plugins that have been marked as `opt`, e.g. by rocks-lazy.nvim.

It will also not load bundles that contain a plugin that matches the above criteria.

You can either override this behaviour by setting `load_opt_plugins = true`,
or you can load the config for a plugin using the `configure(name)` function:

Expand All @@ -220,6 +225,8 @@ require("rocks-config").configure("foo.nvim")
vim.cmd.packadd("foo.nvim")
```

See `:h rocks-config` for more details.

## :book: License

`rocks-config.nvim` is licensed under [GPLv3](./LICENSE).
Expand Down
27 changes: 27 additions & 0 deletions doc/rocks-config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
==============================================================================
rocks-config.nvim Lua API *rocks-config*

rocks-config.RockSpec : RockSpec *rocks-config.RockSpec*

Fields: ~
{config?} (string|boolean)


rocks-config.configure.Opts *rocks-config.configure.Opts*

Fields: ~
{load_bundle_pre?} (fun(bundle_items:string[]))
Callbac that is invoked before loading a plugin bundle.
Takes the bundle items as an argument.


*rocks_config.configure*
rocks_config.configure({plugin}, {opts?})
Load a plugin's configuration

Parameters: ~
{plugin} (string|rocks-config.RockSpec) The name of the plugin to configure
{opts?} (rocks-config.configure.Opts)


vim:tw=78:ts=8:noet:ft=help:norl:
Loading

0 comments on commit 1e60d83

Please sign in to comment.