1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-11 11:31:08 +01:00

treewide: remove with lib;

This commit is contained in:
Gaetan Lepage 2025-12-07 12:28:40 +01:00 committed by Gaétan Lepage
parent cd0443e166
commit 629f9d75f8
67 changed files with 276 additions and 338 deletions

View file

@ -3,9 +3,8 @@
config,
...
}:
with lib;
let
inherit (lib) types;
inherit (lib) types mkOption optionalString;
inherit (lib.nixvim)
defaultNullOpts
keymaps
@ -272,7 +271,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
extraOptions = {
keymaps =
mapAttrs
lib.mapAttrs
(
optionName: action:
mkNullOrOption' {
@ -335,8 +334,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
];
keymaps = lib.pipe cfg.keymaps [
(filterAttrs (n: keymap: keymap != null && keymap.key != null))
(mapAttrsToList (
(lib.filterAttrs (n: keymap: keymap != null && keymap.key != null))
(lib.mapAttrsToList (
name: keymap: {
inherit (keymap) key mode options;
action =
@ -344,7 +343,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
cwd = optionalString (keymap.cwd != null) " cwd=${keymap.cwd}";
keywords = optionalString (
keymap.keywords != null && keymap.keywords != [ ]
) " keywords=${concatStringsSep "," keymap.keywords}";
) " keywords=${lib.concatStringsSep "," keymap.keywords}";
in
"<cmd>${keymap.action}${cwd}${keywords}<cr>";
}