treewide: Reformat with nixfmt

This commit is contained in:
traxys 2024-05-05 19:39:35 +02:00
parent c6281260dc
commit 62f32bfc71
459 changed files with 28139 additions and 26377 deletions

View file

@ -5,69 +5,66 @@
pkgs,
...
}:
with lib; let
with lib;
let
pluginName = "spider";
cfg = config.plugins.${pluginName};
in {
options.plugins.${pluginName} =
helpers.neovim-plugin.extraOptionsOptions
// {
enable = mkEnableOption pluginName;
in
{
options.plugins.${pluginName} = helpers.neovim-plugin.extraOptionsOptions // {
enable = mkEnableOption pluginName;
package = helpers.mkPackageOption pluginName pkgs.vimPlugins.nvim-spider;
package = helpers.mkPackageOption pluginName pkgs.vimPlugins.nvim-spider;
skipInsignificantPunctuation =
helpers.defaultNullOpts.mkBool true "Whether to skip insignificant punctuation.";
skipInsignificantPunctuation = helpers.defaultNullOpts.mkBool true "Whether to skip insignificant punctuation.";
keymaps = {
silent = mkOption {
type = types.bool;
description = "Whether ${pluginName} keymaps should be silent.";
default = false;
};
keymaps = {
silent = mkOption {
type = types.bool;
description = "Whether ${pluginName} keymaps should be silent.";
default = false;
};
motions = mkOption {
type = types.attrsOf types.str;
description = ''
Mappings for spider motions.
The keys are the motion and the values are the keyboard shortcuts.
The shortcut might not necessarily be the same as the motion name.
'';
default = {};
example = {
w = "w";
e = "e";
b = "b";
ge = "ge";
};
motions = mkOption {
type = types.attrsOf types.str;
description = ''
Mappings for spider motions.
The keys are the motion and the values are the keyboard shortcuts.
The shortcut might not necessarily be the same as the motion name.
'';
default = { };
example = {
w = "w";
e = "e";
b = "b";
ge = "ge";
};
};
};
};
config = let
setupOptions =
{
config =
let
setupOptions = {
inherit (cfg) skipInsignificantPunctuation;
}
// cfg.extraOptions;
} // cfg.extraOptions;
mappings =
mapAttrsToList
(
motion: key: {
mode = ["n" "o" "x"];
inherit key;
action.__raw = "function() require('spider').motion('${motion}') end";
options = {
inherit (cfg.keymaps) silent;
desc = "Spider-${motion}";
};
}
)
cfg.keymaps.motions;
in
mappings = mapAttrsToList (motion: key: {
mode = [
"n"
"o"
"x"
];
inherit key;
action.__raw = "function() require('spider').motion('${motion}') end";
options = {
inherit (cfg.keymaps) silent;
desc = "Spider-${motion}";
};
}) cfg.keymaps.motions;
in
mkIf cfg.enable {
extraPlugins = [cfg.package];
extraPlugins = [ cfg.package ];
keymaps = mappings;