2024-11-05 12:15:03 +01:00
|
|
|
{lib, ...}: let
|
2024-11-04 01:25:24 +01:00
|
|
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
|
|
|
inherit (lib.types) attrsOf listOf str bool int submodule;
|
2024-11-05 07:40:44 +01:00
|
|
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
2024-11-05 05:21:32 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
2024-11-04 08:06:41 +01:00
|
|
|
in {
|
2024-11-05 05:21:32 +01:00
|
|
|
options.vim.utility.motion.precognition = {
|
2024-11-04 01:25:24 +01:00
|
|
|
enable = mkEnableOption "precognition.nvim plugin";
|
|
|
|
|
2024-11-05 07:40:44 +01:00
|
|
|
setupOpts = mkPluginSetupOption "precognition.nvim" {
|
|
|
|
startVisible = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "Whether to start 'precognition' automatically.";
|
|
|
|
default = true;
|
|
|
|
};
|
2024-11-04 01:25:24 +01:00
|
|
|
|
2024-11-05 07:40:44 +01:00
|
|
|
showBlankVirtLine = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "Whether to show a blank virtual line when no movements are shown.";
|
|
|
|
default = true;
|
|
|
|
};
|
2024-11-04 01:25:24 +01:00
|
|
|
|
2024-11-05 07:40:44 +01:00
|
|
|
highlightColor = mkOption {
|
|
|
|
type = attrsOf str;
|
2024-11-05 12:15:03 +01:00
|
|
|
default = {link = "Comment";};
|
2024-11-05 07:40:44 +01:00
|
|
|
example = literalExpression ''
|
|
|
|
{ link = "Comment"; }
|
|
|
|
# or
|
|
|
|
{ foreground = "#0000FF"; background = "#000000"; };
|
|
|
|
'';
|
|
|
|
description = ''
|
|
|
|
The highlight for the virtual text.
|
|
|
|
'';
|
|
|
|
};
|
2024-11-04 01:25:24 +01:00
|
|
|
|
2024-11-05 07:40:44 +01:00
|
|
|
hints = mkHintType "What motions display and at what priority.";
|
2024-11-04 01:25:24 +01:00
|
|
|
|
2024-11-05 07:40:44 +01:00
|
|
|
gutterHints =
|
|
|
|
mkHintType "What motions display and at what priority. Only appears in gutters.";
|
2024-11-04 01:25:24 +01:00
|
|
|
|
2024-11-05 07:40:44 +01:00
|
|
|
disabled_fts = mkOption {
|
|
|
|
type = listOf str;
|
2024-11-07 00:32:40 +01:00
|
|
|
description = "Filetypes that automatically disable 'precognition.'";
|
2024-11-05 07:40:44 +01:00
|
|
|
default = ["startify"];
|
|
|
|
example = literalExpression ''["startify"]'';
|
|
|
|
};
|
2024-11-04 01:25:24 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|