mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
modules/visuals: migrate plugins to setupOpts
This commit is contained in:
parent
b3f51048db
commit
a6bb6e1b3e
28 changed files with 692 additions and 396 deletions
21
modules/plugins/visuals/highlight-undo/config.nix
Normal file
21
modules/plugins/visuals/highlight-undo/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.visuals.highlight-undo;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["highlight-undo"];
|
||||
|
||||
pluginRC.highlight-undo = entryAnywhere ''
|
||||
require("highlight-undo").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/highlight-undo/default.nix
Normal file
6
modules/plugins/visuals/highlight-undo/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./highlight-undo.nix
|
||||
];
|
||||
}
|
32
modules/plugins/visuals/highlight-undo/highlight-undo.nix
Normal file
32
modules/plugins/visuals/highlight-undo/highlight-undo.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRemovedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) int;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
|
||||
checkDocsMsg = ''
|
||||
highlight-undo.nvim has deprecated previously used configuration options in
|
||||
a recent update, so previous values will no longer work as expected.
|
||||
|
||||
Please use `vim.visuals.highlight-undo.setupOpts` with upstream instructions
|
||||
'';
|
||||
in {
|
||||
imports = [
|
||||
# This gives a lot of error messages for those with default values set or modified. Could
|
||||
# there be a better way to handle his? Perhaps an assertion?
|
||||
(mkRemovedOptionModule ["vim" "visuals" "highlight-undo" "highlightForCount"] checkDocsMsg)
|
||||
(mkRemovedOptionModule ["vim" "visuals" "highlight-undo" "undo" "hlGroup"] checkDocsMsg)
|
||||
(mkRemovedOptionModule ["vim" "visuals" "highlight-undo" "redo" "hlGroup"] checkDocsMsg)
|
||||
];
|
||||
|
||||
options.vim.visuals.highlight-undo = {
|
||||
enable = mkEnableOption "highlight undo [highlight-undo]";
|
||||
setupOpts = mkPluginSetupOption "highlight-undo" {
|
||||
duration = mkOption {
|
||||
type = int;
|
||||
default = 500;
|
||||
description = "Duration of the highlight";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue