mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/*: use new mkSettingsRenamedOptionModules
This commit is contained in:
parent
0ddf6e39ac
commit
c179d47d3d
37 changed files with 1176 additions and 1510 deletions
|
@ -14,82 +14,12 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
|
||||
# TODO: added 204-10-05 remove after 24.11
|
||||
deprecateExtraOptions = true;
|
||||
optionsRenamedToSettings = [
|
||||
"logLevel"
|
||||
[
|
||||
"sessionLens"
|
||||
"loadOnSetup"
|
||||
]
|
||||
[
|
||||
"sessionLens"
|
||||
"themeConf"
|
||||
]
|
||||
[
|
||||
"sessionLens"
|
||||
"previewer"
|
||||
]
|
||||
[
|
||||
"sessionControl"
|
||||
"controlDir"
|
||||
]
|
||||
[
|
||||
"sessionControl"
|
||||
"controlFilename"
|
||||
]
|
||||
optionsRenamedToSettings = import ./renamed-options.nix;
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule [ "plugins" "auto-session" "cwdChangeHandling" ] ''
|
||||
Please switch to `cwd_change_handling` with just a boolean value.
|
||||
'')
|
||||
];
|
||||
# NOTE: rename the old settings to use the correct variables
|
||||
imports =
|
||||
let
|
||||
basePluginPath = [
|
||||
"plugins"
|
||||
"auto-session"
|
||||
];
|
||||
settingsPath = basePluginPath ++ [ "settings" ];
|
||||
nestedAutoSessionPluginPath = basePluginPath ++ [ "autoSession" ];
|
||||
in
|
||||
[
|
||||
(lib.mkRenamedOptionModule (
|
||||
basePluginPath
|
||||
++ [
|
||||
"autoSave"
|
||||
"enabled"
|
||||
]
|
||||
) (settingsPath ++ [ "auto_save" ]))
|
||||
(lib.mkRenamedOptionModule (
|
||||
basePluginPath
|
||||
++ [
|
||||
"autoRestore"
|
||||
"enabled"
|
||||
]
|
||||
) (settingsPath ++ [ "auto_restore" ]))
|
||||
(lib.mkRenamedOptionModule (basePluginPath ++ [ "bypassSessionSaveFileTypes" ]) (
|
||||
settingsPath ++ [ "bypass_save_filetypes" ]
|
||||
))
|
||||
(lib.mkRenamedOptionModule (nestedAutoSessionPluginPath ++ [ "enableLastSession" ]) (
|
||||
settingsPath ++ [ "auto_restore_last_session" ]
|
||||
))
|
||||
(lib.mkRenamedOptionModule (nestedAutoSessionPluginPath ++ [ "rootDir" ]) (
|
||||
settingsPath ++ [ "root_dir" ]
|
||||
))
|
||||
(lib.mkRenamedOptionModule (nestedAutoSessionPluginPath ++ [ "enabled" ]) (
|
||||
settingsPath ++ [ "enabled" ]
|
||||
))
|
||||
(lib.mkRenamedOptionModule (nestedAutoSessionPluginPath ++ [ "createEnabled" ]) (
|
||||
settingsPath ++ [ "auto_create" ]
|
||||
))
|
||||
(lib.mkRenamedOptionModule (nestedAutoSessionPluginPath ++ [ "suppressDirs" ]) (
|
||||
settingsPath ++ [ "suppressed_dirs" ]
|
||||
))
|
||||
(lib.mkRenamedOptionModule (nestedAutoSessionPluginPath ++ [ "allowedDirs" ]) (
|
||||
settingsPath ++ [ "allowed_dirs" ]
|
||||
))
|
||||
(lib.mkRenamedOptionModule (nestedAutoSessionPluginPath ++ [ "useGitBranch" ]) (
|
||||
settingsPath ++ [ "use_git_branch" ]
|
||||
))
|
||||
(lib.mkRemovedOptionModule (basePluginPath ++ [ "cwdChangeHandling" ]) ''
|
||||
Please switch to `cwd_change_handling` with just a boolean value.
|
||||
'')
|
||||
];
|
||||
|
||||
settingsOptions = {
|
||||
enabled = defaultNullOpts.mkBool true ''
|
||||
|
|
90
plugins/by-name/auto-session/renamed-options.nix
Normal file
90
plugins/by-name/auto-session/renamed-options.nix
Normal file
|
@ -0,0 +1,90 @@
|
|||
[
|
||||
"logLevel"
|
||||
[
|
||||
"sessionLens"
|
||||
"loadOnSetup"
|
||||
]
|
||||
[
|
||||
"sessionLens"
|
||||
"themeConf"
|
||||
]
|
||||
[
|
||||
"sessionLens"
|
||||
"previewer"
|
||||
]
|
||||
[
|
||||
"sessionControl"
|
||||
"controlDir"
|
||||
]
|
||||
[
|
||||
"sessionControl"
|
||||
"controlFilename"
|
||||
]
|
||||
{
|
||||
old = [
|
||||
"autoSave"
|
||||
"enabled"
|
||||
];
|
||||
new = "auto_save";
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"autoRestore"
|
||||
"enabled"
|
||||
];
|
||||
new = "auto_auto_restore";
|
||||
}
|
||||
{
|
||||
old = "bypassSessionSaveFileTypes";
|
||||
new = "bypass_save_filetypes";
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"autoSession"
|
||||
"enableLastSession"
|
||||
];
|
||||
new = "auto_restore_last_session";
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"autoSession"
|
||||
"rootDir"
|
||||
];
|
||||
new = "root_dir";
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"autoSession"
|
||||
"enabled"
|
||||
];
|
||||
new = "enabled";
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"autoSession"
|
||||
"createEnabled"
|
||||
];
|
||||
new = "auto_create";
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"autoSession"
|
||||
"suppressDirs"
|
||||
];
|
||||
new = "suppressed_dirs";
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"autoSession"
|
||||
"allowedDirs"
|
||||
];
|
||||
new = "allowed_dirs";
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"autoSession"
|
||||
"useGitBranch"
|
||||
];
|
||||
new = "use_git_branch";
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue