Compare commits

..

1 commit

Author SHA1 Message Date
Noire
0e469a5ecf
Merge 39e27e17a2 into 8ff50562d7 2024-11-05 04:21:38 +00:00
4 changed files with 56 additions and 50 deletions

View file

@ -168,7 +168,6 @@ isMaximal: {
precognition = {
enable = true;
setupOpts = {
startVisible = true;
showBlankVirtLine = true;
@ -188,7 +187,6 @@ isMaximal: {
};
};
};
};
images = {
image-nvim.enable = false;

View file

@ -4,6 +4,9 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
inherit (builtins) toString;
cfg = config.vim.utility.motion.precognition;
in {
@ -14,8 +17,15 @@ in {
"precognition-nvim"
];
vim.luaConfigRC.precognition = lib.nvim.dag.entryAnywhere ''
require('precognition').setup(${lib.nvim.lua.toLuaObject cfg.setupOpts})
vim.pluginRC.precognition-nvim = entryAnywhere ''
require("precognition").setup({
startVisible = ${toString cfg.startVisible},
showBlankVirtLine = ${toString cfg.showBlankVirtLine},
highlightColor = (${toLuaObject cfg.highlightColor}), --{ link = "Comment" },
hints = (${toLuaObject cfg.hints}),
gutterHints = (${toLuaObject cfg.gutterHints}),
disabled_fts = (${toLuaObject cfg.disabled_fts}),
});
'';
};
}

View file

@ -1,4 +1,4 @@
{
_: {
imports = [
./precognition.nix
./config.nix

View file

@ -1,7 +1,6 @@
{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 {
@ -26,7 +25,6 @@ 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.";
@ -41,12 +39,13 @@ in {
highlightColor = mkOption {
type = attrsOf str;
default = {link = "Comment";};
example = literalExpression ''
{ link = "Comment"; }
# or
{ foreground = "#0000FF"; background = "#000000"; };
'';
default = {link = "Comment";};
description = ''
The highlight for the virtual text.
'';
@ -63,5 +62,4 @@ in {
example = literalExpression ''["startify"]'';
};
};
};
}