Compare commits

...

4 commits

Author SHA1 Message Date
Noire
e337369821
Merge e43b18cb9f into 8ff50562d7 2024-11-05 04:20:33 -07:00
Nowaaru
e43b18cb9f
utility/precognition: format 2024-11-05 04:20:11 -07:00
Nowaaru
b0641a8c0b
utility/precognition: remove unnecessary function parameter 2024-11-05 04:13:22 -07:00
Nowaaru
517a6aa06e
utility/precognition: convert to setupOpts
honestly raf was cooking with this one.
it's much nicer to use compared to interpolation lol
2024-11-04 23:40:44 -07:00
4 changed files with 50 additions and 56 deletions

View file

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

View file

@ -4,9 +4,6 @@
...
}: 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 {
@ -17,15 +14,8 @@ in {
"precognition-nvim"
];
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}),
});
vim.luaConfigRC.precognition = lib.nvim.dag.entryAnywhere ''
require('precognition').setup(${lib.nvim.lua.toLuaObject cfg.setupOpts})
'';
};
}

View file

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

View file

@ -1,6 +1,7 @@
{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 {
@ -25,6 +26,7 @@ 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.";
@ -39,13 +41,12 @@ 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.
'';
@ -62,4 +63,5 @@ in {
example = literalExpression ''["startify"]'';
};
};
};
}