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

View file

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

View file

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