plugins/goyo: switch to settings option

This commit is contained in:
Gaetan Lepage 2024-03-01 14:10:59 +01:00 committed by Gaétan Lepage
parent f9280a6865
commit ec687c5ade
3 changed files with 25 additions and 20 deletions

View file

@ -12,25 +12,28 @@ with lib;
originalName = "goyo.vim"; originalName = "goyo.vim";
defaultPackage = pkgs.vimPlugins.goyo-vim; defaultPackage = pkgs.vimPlugins.goyo-vim;
globalPrefix = "goyo_"; globalPrefix = "goyo_";
# TODO introduced 2024-03-01: remove 2024-05-01
deprecateExtraConfig = true; deprecateExtraConfig = true;
optionsRenamedToSettings = [
"width"
"height"
];
imports = [
(
mkRenamedOptionModule
["plugins" "goyo" "showLineNumbers"]
["plugins" "goyo" "settings" "linenr"]
)
];
options = { settingsOptions = {
width = mkDefaultOpt { width = helpers.mkNullOrOption types.ints.unsigned "width";
description = "Width";
global = "width";
type = types.int;
};
height = mkDefaultOpt { height = helpers.mkNullOrOption types.ints.unsigned "height";
description = "Height";
global = "height";
type = types.int;
};
showLineNumbers = mkDefaultOpt { linenr = helpers.defaultNullOpts.mkBool false ''
description = "Show line numbers when in Goyo mode"; Show line numbers when in Goyo mode.
global = "linenr"; '';
type = types.bool;
};
}; };
} }

View file

@ -22,7 +22,7 @@
goyo = { goyo = {
enable = true; enable = true;
showLineNumbers = false; settings.linenr = false;
}; };
lsp = { lsp = {

View file

@ -7,9 +7,11 @@
plugins.goyo = { plugins.goyo = {
enable = true; enable = true;
settings = {
width = 80; width = 80;
height = 85; height = 85;
showLineNumbers = false; linenr = false;
};
}; };
}; };
} }