mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 01:04:34 +02:00
plugins/*: use new mkSettingsRenamedOptionModules
This commit is contained in:
parent
0ddf6e39ac
commit
c179d47d3d
37 changed files with 1176 additions and 1510 deletions
|
@ -25,60 +25,61 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
"colorizer"
|
||||
];
|
||||
|
||||
optionsToRename = [
|
||||
"RGB"
|
||||
"RRGGBB"
|
||||
"names"
|
||||
"RRGGBBAA"
|
||||
"AARRGGBB"
|
||||
"rgb_fn"
|
||||
"hsl_fn"
|
||||
"tailwind"
|
||||
"sass"
|
||||
"virtualtext"
|
||||
"virtualtext_inline"
|
||||
"virtualtext_mode"
|
||||
"always_update"
|
||||
];
|
||||
|
||||
renameOption =
|
||||
optionName:
|
||||
lib.mkRenamedOptionModule
|
||||
(
|
||||
oldPluginPath
|
||||
++ [
|
||||
# {
|
||||
# old = ["userDefaultOptions" "RGB"]; }
|
||||
# new = ["settings" "user_default_options" "RGB"];
|
||||
# }
|
||||
userOptsRenames =
|
||||
map
|
||||
(name: {
|
||||
old = [
|
||||
"userDefaultOptions"
|
||||
optionName
|
||||
]
|
||||
)
|
||||
(
|
||||
newPluginPath
|
||||
++ [
|
||||
name
|
||||
];
|
||||
new = [
|
||||
"settings"
|
||||
"user_default_options"
|
||||
optionName
|
||||
]
|
||||
);
|
||||
name
|
||||
];
|
||||
})
|
||||
[
|
||||
"RGB"
|
||||
"RRGGBB"
|
||||
"names"
|
||||
"RRGGBBAA"
|
||||
"AARRGGBB"
|
||||
"rgb_fn"
|
||||
"hsl_fn"
|
||||
"tailwind"
|
||||
"sass"
|
||||
"virtualtext"
|
||||
"virtualtext_inline"
|
||||
"virtualtext_mode"
|
||||
"always_update"
|
||||
];
|
||||
|
||||
in
|
||||
map renameOption optionsToRename
|
||||
++
|
||||
lib.mapAttrsToList
|
||||
(
|
||||
oldOptionName: newPath:
|
||||
lib.mkRenamedOptionModule (oldPluginPath ++ [ oldOptionName ]) (newPluginPath ++ newPath)
|
||||
)
|
||||
lib.nixvim.mkSettingsRenamedOptionModules oldPluginPath newPluginPath (
|
||||
[
|
||||
"enable"
|
||||
"package"
|
||||
{
|
||||
enable = [ "enable" ];
|
||||
package = [ "package" ];
|
||||
fileTypes = [
|
||||
old = "fileTypes";
|
||||
new = [
|
||||
"settings"
|
||||
"filetypes"
|
||||
];
|
||||
bufTypes = [
|
||||
}
|
||||
{
|
||||
old = "bufTypes";
|
||||
new = [
|
||||
"settings"
|
||||
"bufTypes"
|
||||
"buftypes"
|
||||
];
|
||||
};
|
||||
}
|
||||
]
|
||||
++ userOptsRenames
|
||||
);
|
||||
|
||||
settingsOptions =
|
||||
let
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue