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;
|
2024-11-07 06:45:02 +01:00
|
|
|
description = "The easier-to-read depiction of the motion";
|
2024-11-05 05:21:32 +01:00
|
|
|
};
|
|
|
|
prio = mkOption {
|
|
|
|
type = int;
|
2024-11-07 06:45:02 +01:00
|
|
|
description = "The priority of the hint";
|
2024-11-05 05:21:32 +01:00
|
|
|
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;
|
2024-11-07 06:45:02 +01:00
|
|
|
description = "Whether to start 'precognition' automatically";
|
2024-11-05 07:40:44 +01:00
|
|
|
default = true;
|
|
|
|
};
|
2024-11-04 01:25:24 +01:00
|
|
|
|
2024-11-05 07:40:44 +01:00
|
|
|
showBlankVirtLine = mkOption {
|
|
|
|
type = bool;
|
2024-11-07 06:45:02 +01:00
|
|
|
description = "Whether to show a blank virtual line when no movements are shown";
|
2024-11-05 07:40:44 +01:00
|
|
|
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 = ''
|
2024-11-07 06:45:02 +01:00
|
|
|
The highlight for the virtual text
|
2024-11-05 07:40:44 +01:00
|
|
|
'';
|
|
|
|
};
|
2024-11-04 01:25:24 +01:00
|
|
|
|
2024-11-07 06:45:02 +01:00
|
|
|
hints = mkHintType "What motions display and at what priority";
|
2024-11-04 01:25:24 +01:00
|
|
|
|
2024-11-07 06:44:37 +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 06:45:02 +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
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|