mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
utility/precognition: convert to setupOpts
honestly raf was cooking with this one. it's much nicer to use compared to interpolation lol
This commit is contained in:
parent
39e27e17a2
commit
517a6aa06e
3 changed files with 51 additions and 55 deletions
|
@ -168,21 +168,23 @@ isMaximal: {
|
||||||
|
|
||||||
precognition = {
|
precognition = {
|
||||||
enable = true;
|
enable = true;
|
||||||
startVisible = true;
|
setupOpts = {
|
||||||
showBlankVirtLine = true;
|
startVisible = true;
|
||||||
|
showBlankVirtLine = true;
|
||||||
|
|
||||||
# highlightColor - automatically set by theme
|
# highlightColor - automatically set by theme
|
||||||
disabled_fts = ["startify" "alpha" "dashboard"];
|
disabled_fts = ["startify" "alpha" "dashboard"];
|
||||||
gutterHints = {
|
gutterHints = {
|
||||||
gg = {
|
gg = {
|
||||||
text = "gg";
|
text = "gg";
|
||||||
prio = 2;
|
prio = 2;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
hints = {
|
||||||
hints = {
|
Caret = {
|
||||||
Caret = {
|
text = "^";
|
||||||
text = "^";
|
prio = 10;
|
||||||
prio = 10;
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
inherit (builtins) toString;
|
|
||||||
|
|
||||||
cfg = config.vim.utility.motion.precognition;
|
cfg = config.vim.utility.motion.precognition;
|
||||||
in {
|
in {
|
||||||
|
@ -17,15 +14,8 @@ in {
|
||||||
"precognition-nvim"
|
"precognition-nvim"
|
||||||
];
|
];
|
||||||
|
|
||||||
vim.pluginRC.precognition-nvim = entryAnywhere ''
|
vim.luaConfigRC.precognition = lib.nvim.dag.entryAnywhere ''
|
||||||
require("precognition").setup({
|
require('precognition').setup(${lib.nvim.lua.toLuaObject cfg.setupOpts})
|
||||||
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}),
|
|
||||||
});
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{lib, ...}: let
|
{lib, ...}:
|
||||||
|
let
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
inherit (lib.types) attrsOf listOf str bool int submodule;
|
inherit (lib.types) attrsOf listOf str bool int submodule;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
|
||||||
mkHintType = description:
|
mkHintType = description:
|
||||||
mkOption {
|
mkOption {
|
||||||
|
@ -25,41 +27,43 @@ in {
|
||||||
options.vim.utility.motion.precognition = {
|
options.vim.utility.motion.precognition = {
|
||||||
enable = mkEnableOption "precognition.nvim plugin";
|
enable = mkEnableOption "precognition.nvim plugin";
|
||||||
|
|
||||||
startVisible = mkOption {
|
setupOpts = mkPluginSetupOption "precognition.nvim" {
|
||||||
type = bool;
|
startVisible = mkOption {
|
||||||
description = "Whether to start 'precognition' automatically.";
|
type = bool;
|
||||||
default = true;
|
description = "Whether to start 'precognition' automatically.";
|
||||||
};
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
showBlankVirtLine = mkOption {
|
showBlankVirtLine = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
description = "Whether to show a blank virtual line when no movements are shown.";
|
description = "Whether to show a blank virtual line when no movements are shown.";
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
highlightColor = mkOption {
|
highlightColor = mkOption {
|
||||||
type = attrsOf str;
|
type = attrsOf str;
|
||||||
|
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
{ link = "Comment"; }
|
{ link = "Comment"; }
|
||||||
# or
|
# or
|
||||||
{ foreground = "#0000FF"; background = "#000000"; };
|
{ foreground = "#0000FF"; background = "#000000"; };
|
||||||
'';
|
'';
|
||||||
default = {link = "Comment";};
|
default = {link = "Comment";};
|
||||||
description = ''
|
description = ''
|
||||||
The highlight for the virtual text.
|
The highlight for the virtual text.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
hints = mkHintType "What motions display and at what priority.";
|
hints = mkHintType "What motions display and at what priority.";
|
||||||
|
|
||||||
gutterHints =
|
gutterHints =
|
||||||
mkHintType "What motions display and at what priority. Only appears in gutters.";
|
mkHintType "What motions display and at what priority. Only appears in gutters.";
|
||||||
|
|
||||||
disabled_fts = mkOption {
|
disabled_fts = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
default = ["startify"];
|
default = ["startify"];
|
||||||
example = literalExpression ''["startify"]'';
|
example = literalExpression ''["startify"]'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue