mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-08 03:11:36 +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
35
modules/plugins/visuals/cinnamon-nvim/cinnamon-nvim.nix
Normal file
35
modules/plugins/visuals/cinnamon-nvim/cinnamon-nvim.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRemovedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) submodule attrs attrsOf;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
imports = [
|
||||
(mkRemovedOptionModule ["vim" "visuals" "smoothScroll"] ''
|
||||
`vim.visuals.smoothScroll` has been removed. You may consider enabling the
|
||||
option `vim.visuals.cinnamon-nvim` to repliace previous smooth scrolling
|
||||
behaviour.
|
||||
'')
|
||||
];
|
||||
|
||||
options.vim.visuals.cinnamon-nvim = {
|
||||
enable = mkEnableOption "smooth scrolling for ANY command [cinnamon-nvim]";
|
||||
setupOpts = mkPluginSetupOption "cinnamon.nvim" {
|
||||
options = mkOption {
|
||||
type = attrs;
|
||||
default = {
|
||||
# Defaults provided for the sake of documentation only!
|
||||
# Who would've guessed setupOpts.options would be confusing?
|
||||
mode = "cursor";
|
||||
count_only = false;
|
||||
};
|
||||
description = "Scroll options";
|
||||
};
|
||||
|
||||
keymaps = {
|
||||
basic = mkEnableOption "basic animation keymaps";
|
||||
extra = mkEnableOption "extra animation keymaps";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
21
modules/plugins/visuals/cinnamon-nvim/config.nix
Normal file
21
modules/plugins/visuals/cinnamon-nvim/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.cinnamon-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["cinnamon-nvim"];
|
||||
|
||||
pluginRC.cursorline = entryAnywhere ''
|
||||
require("cinnamon").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/cinnamon-nvim/default.nix
Normal file
6
modules/plugins/visuals/cinnamon-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./cinnamon-nvim.nix
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue