nvf/modules/plugins/utility/motion/precognition/precognition.nix
Nowaaru 517a6aa06e
utility/precognition: convert to setupOpts
honestly raf was cooking with this one.
it's much nicer to use compared to interpolation lol
2024-11-04 23:40:44 -07:00

70 lines
1.8 KiB
Nix

{lib, ...}:
let
inherit (lib.options) mkEnableOption mkOption literalExpression;
inherit (lib.types) attrsOf listOf str bool int submodule;
inherit (lib.nvim.types) mkPluginSetupOption;
mkHintType = description:
mkOption {
inherit description;
default = {};
type = attrsOf (submodule {
options = {
text = mkOption {
type = str;
description = "The easier-to-read depiction of the motion.";
};
prio = mkOption {
type = int;
description = "The priority of the hint.";
example = 10;
default = 1;
};
};
});
};
in {
options.vim.utility.motion.precognition = {
enable = mkEnableOption "precognition.nvim plugin";
setupOpts = mkPluginSetupOption "precognition.nvim" {
startVisible = mkOption {
type = bool;
description = "Whether to start 'precognition' automatically.";
default = true;
};
showBlankVirtLine = mkOption {
type = bool;
description = "Whether to show a blank virtual line when no movements are shown.";
default = true;
};
highlightColor = mkOption {
type = attrsOf str;
example = literalExpression ''
{ link = "Comment"; }
# or
{ foreground = "#0000FF"; background = "#000000"; };
'';
default = {link = "Comment";};
description = ''
The highlight for the virtual text.
'';
};
hints = mkHintType "What motions display and at what priority.";
gutterHints =
mkHintType "What motions display and at what priority. Only appears in gutters.";
disabled_fts = mkOption {
type = listOf str;
default = ["startify"];
example = literalExpression ''["startify"]'';
};
};
};
}