Update the extraConfig function to access settings through opts parameter
instead of direct import. Also remove the unused options import for cleaner code.
Add a new `keymaps` option to the lz-n plugin that allows users to define
keymaps that use lz.n's keymap(<plugin>).set functionality. This enables
users to create keymaps that lazy-load plugins when specific keys are pressed,
using the familiar vim.keymap.set() API style.
The implementation:
- Adds a new `keymaps` option using mkMapOptionSubmodule with a custom plugin property
- Exposes a simple and consistent interface for configuring lazy-loaded keymaps
- Processes these keymaps to generate corresponding Lua code with require('lz.n').keymap().set()
- Cleanly separates plugin specs from keymap definitions while preserving their relationship
This commit adds a `plugins.<name>.luaConfig` section controlling the
plugin specific configuration.
The section contains the internal `init` option, containing the plugin's
initialization code.
It also contains the public `pre` and `post` options, that allow to add
code before & after the `init` section
Finally, it contains the `final` option, being the concatenation of the
three previous options.
This allows to avoid calling `mkRaw` on lua functions, as they will get
applied automatically.
This could also help in the future to refactor the use of Lua code to
make it more user-friendly.
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition.
The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix.
For module development, the main change is that you should no longer prefix your modules with programs.nixvim..