diff --git a/modules/plugins/utility/motion/precognition/config.nix b/modules/plugins/utility/motion/precognition/config.nix new file mode 100644 index 0000000..f5aeb94 --- /dev/null +++ b/modules/plugins/utility/motion/precognition/config.nix @@ -0,0 +1,46 @@ +{ + config, + lib, + ... +}: let + cfg = config.vim.utility.motion.precognition; + inherit (lib.modules) mkIf; + inherit (lib.nvim.dag) entryAnywhere; +in { + config = + mkIf cfg.enable + { + vim.startPlugins = [ + "precognition-nvim" + ]; + + vim.pluginRC.precognition-nvim = entryAnywhere '' + require("precognition").setup({ + startVisible = true, + showBlankVirtLine = true, + highlightColor = { link = "Comment" }, + hints = { + Caret = { text = "^", prio = 2 }, + Dollar = { text = "$", prio = 1 }, + MatchingPair = { text = "%", prio = 5 }, + Zero = { text = "0", prio = 1 }, + w = { text = "w", prio = 10 }, + b = { text = "b", prio = 9 }, + e = { text = "e", prio = 8 }, + W = { text = "W", prio = 7 }, + B = { text = "B", prio = 6 }, + E = { text = "E", prio = 5 }, + }, + gutterHints = { + G = { text = "G", prio = 10 }, + gg = { text = "gg", prio = 9 }, + PrevParagraph = { text = "{", prio = 8 }, + NextParagraph = { text = "}", prio = 8 }, + }, + disabled_fts = { + "startify", + }, + }) + ''; + }; +} diff --git a/modules/plugins/utility/motion/precognition/default.nix b/modules/plugins/utility/motion/precognition/default.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/plugins/utility/motion/precognition/precognition.nix b/modules/plugins/utility/motion/precognition/precognition.nix new file mode 100644 index 0000000..de9bd63 --- /dev/null +++ b/modules/plugins/utility/motion/precognition/precognition.nix @@ -0,0 +1,71 @@ +{ lib, ... }: + +let + inherit (lib.options) mkEnableOption mkOption literalExpression; + inherit (lib.types) attrsOf listOf str bool int submodule; + +in +{ + options.vim.utility.motion.precognition = rec { + enable = mkEnableOption "precognition.nvim plugin"; + + 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 = { + type = attrsOf (submodule { + options = { + text = mkOption { + type = str; + description = "The easier-to-read depiction of the motion."; + }; + prio = { + type = str; + description = "The priority of the hint."; + example = str; + }; + }; + }); + }; + + gutterHints = hints; + + disabled_fts = mkOption { + type = listOf str; + default = [ "startify" ]; + example = literalExpression ''[ "startify" ]''; + }; + + mappings = { + # enable = mkOption { + # }; + # + # disable = mkOption { + # }; + # + # toggle = mkOption { + # }; + }; + }; +}