mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-24 04:18:03 +00:00
visuals: move cinnamon-nvim to its own module; deprecate smoothScroll
The option visuals.smoothScroll was confusing as there can be more than one backend.
This commit is contained in:
parent
688a41b621
commit
658d380232
5 changed files with 69 additions and 5 deletions
38
modules/plugins/visuals/cinnamon-nvim/cinnamon-nvim.nix
Normal file
38
modules/plugins/visuals/cinnamon-nvim/cinnamon-nvim.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.modules) mkRemovedOptionModule;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) submodule attrs;
|
||||||
|
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 = mkOption {
|
||||||
|
description = "Keymap options for Cinnamon. Please see documentation before enablg";
|
||||||
|
type = submodule {
|
||||||
|
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
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./fidget
|
./cinnamon-nvim
|
||||||
|
./fidget-nvim
|
||||||
./indent-blankline
|
./indent-blankline
|
||||||
./nvim-cursorline
|
./nvim-cursorline
|
||||||
./nvim-scrollbar
|
./nvim-scrollbar
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.types) int bool str nullOr either listOf attrsOf;
|
inherit (lib.types) int bool str;
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
|
|
||||||
cfg = config.vim.visuals;
|
cfg = config.vim.visuals;
|
||||||
|
@ -12,8 +12,6 @@ in {
|
||||||
options.vim.visuals = {
|
options.vim.visuals = {
|
||||||
enable = mkEnableOption "Visual enhancements.";
|
enable = mkEnableOption "Visual enhancements.";
|
||||||
|
|
||||||
smoothScroll.enable = mkEnableOption "smooth scrolling [cinnamon-nvim]";
|
|
||||||
|
|
||||||
cellularAutomaton = {
|
cellularAutomaton = {
|
||||||
enable = mkEnableOption "cellular automaton [cellular-automaton]";
|
enable = mkEnableOption "cellular automaton [cellular-automaton]";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue