mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
lib/neovim-plugin: use mkLazyLoadOption
This commit is contained in:
parent
6ed719dba8
commit
da30527de1
2 changed files with 9 additions and 28 deletions
|
@ -114,28 +114,11 @@
|
||||||
internal = true;
|
internal = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
lazyLoad = lib.mkOption {
|
lazyLoad = lib.nixvim.mkLazyLoadOption {
|
||||||
default = {
|
inherit originalName;
|
||||||
enable = false;
|
lazyLoadDefaults = (
|
||||||
};
|
lib.optionalAttrs (isColorscheme && colorscheme != null) { inherit colorscheme; }
|
||||||
description = ''
|
);
|
||||||
Lazy load configuration settings.
|
|
||||||
'';
|
|
||||||
type = lib.types.submodule {
|
|
||||||
options = {
|
|
||||||
enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
type = lib.types.bool;
|
|
||||||
description = ''
|
|
||||||
Whether to lazy load the plugin.
|
|
||||||
|
|
||||||
If you enable this, the plugin's lua configuration will need to be manually loaded by other means.
|
|
||||||
|
|
||||||
A usage would be passing the plugin's luaConfig to the `plugins.lz-n.plugins` configuration.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs hasSettings {
|
// lib.optionalAttrs hasSettings {
|
||||||
|
|
|
@ -412,13 +412,11 @@ rec {
|
||||||
Equivalence: lz.n => ft; lazy.nvim => ft
|
Equivalence: lz.n => ft; lazy.nvim => ft
|
||||||
'';
|
'';
|
||||||
|
|
||||||
keys =
|
keys = mkListOf (types.attrsOf types.anything) (lazyLoadDefaults.keys or null) ''
|
||||||
mkNullable (types.listOf lib.nixvim.keymaps.mapOptionSubmodule) (lazyLoadDefaults.keys or null)
|
Lazy-load on key mapping.
|
||||||
''
|
|
||||||
Lazy-load on key mapping. Use the same format as `config.keymaps`.
|
|
||||||
|
|
||||||
Equivalence: lz.n => keys; lazy.nvim => keys
|
Equivalence: lz.n => keys; lazy.nvim => keys
|
||||||
'';
|
'';
|
||||||
|
|
||||||
colorscheme = mkNullable triggerType (lazyLoadDefaults.colorscheme or null) ''
|
colorscheme = mkNullable triggerType (lazyLoadDefaults.colorscheme or null) ''
|
||||||
Lazy-load on colorscheme.
|
Lazy-load on colorscheme.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue