neovim-flake/modules/plugins/utility/motion/precognition/precognition.nix

71 lines
1.9 KiB
Nix
Raw Normal View History

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;
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";
2024-11-05 05:21:32 +01:00
};
prio = mkOption {
type = int;
description = "The priority of the hint";
2024-11-05 05:21:32 +01:00
example = 10;
default = 1;
};
};
});
};
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";
setupOpts = mkPluginSetupOption "precognition.nvim" {
startVisible = mkOption {
type = bool;
description = "Whether to start 'precognition' automatically";
default = true;
};
2024-11-04 01:25:24 +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
highlightColor = mkOption {
type = attrsOf str;
2024-11-05 12:15:03 +01:00
default = {link = "Comment";};
example = literalExpression ''
{ link = "Comment"; }
# or
{ foreground = "#0000FF"; background = "#000000"; };
'';
description = ''
The highlight for the virtual text
'';
};
2024-11-04 01:25:24 +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
disabled_fts = mkOption {
type = listOf str;
description = "Filetypes that automatically disable 'precognition'";
default = ["startify"];
example = literalExpression ''["startify"]'';
};
2024-11-04 01:25:24 +01:00
};
};
}