mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 22:55:58 +01:00
visuals: move nvim-scrollbar to its own module; switch to setupOpts
This commit is contained in:
parent
db54345de1
commit
95b09bc3a4
7 changed files with 67 additions and 35 deletions
34
flake.lock
34
flake.lock
|
@ -1278,6 +1278,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-nvim-scrollbar": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1717406282,
|
||||
"narHash": "sha256-Y5qCD2pjfs9fodH9Y1waefVuj/m33kx4ExMmAa/qoP4=",
|
||||
"owner": "petertriho",
|
||||
"repo": "nvim-scrollbar",
|
||||
"rev": "d09f14aa16c9f2748e77008f9da7b1f76e4e7b85",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "petertriho",
|
||||
"repo": "nvim-scrollbar",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-nvim-session-manager": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -1534,22 +1550,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-scrollbar-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1684886154,
|
||||
"narHash": "sha256-zLBexSxQCn9HPY04a9w/UCJP1F5ShI2X12I9xE9H0cM=",
|
||||
"owner": "petertriho",
|
||||
"repo": "nvim-scrollbar",
|
||||
"rev": "35f99d559041c7c0eff3a41f9093581ceea534e8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "petertriho",
|
||||
"repo": "nvim-scrollbar",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-smartcolumn": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -1920,6 +1920,7 @@
|
|||
"plugin-nvim-neoclip": "plugin-nvim-neoclip",
|
||||
"plugin-nvim-nio": "plugin-nvim-nio",
|
||||
"plugin-nvim-notify": "plugin-nvim-notify",
|
||||
"plugin-nvim-scrollbar": "plugin-nvim-scrollbar",
|
||||
"plugin-nvim-session-manager": "plugin-nvim-session-manager",
|
||||
"plugin-nvim-surround": "plugin-nvim-surround",
|
||||
"plugin-nvim-tree-lua": "plugin-nvim-tree-lua",
|
||||
|
@ -1936,7 +1937,6 @@
|
|||
"plugin-registers": "plugin-registers",
|
||||
"plugin-rose-pine": "plugin-rose-pine",
|
||||
"plugin-rustaceanvim": "plugin-rustaceanvim",
|
||||
"plugin-scrollbar-nvim": "plugin-scrollbar-nvim",
|
||||
"plugin-smartcolumn": "plugin-smartcolumn",
|
||||
"plugin-sqls-nvim": "plugin-sqls-nvim",
|
||||
"plugin-tabular": "plugin-tabular",
|
||||
|
|
|
@ -418,7 +418,7 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
plugin-scrollbar-nvim = {
|
||||
plugin-nvim-scrollbar = {
|
||||
url = "github:petertriho/nvim-scrollbar";
|
||||
flake = false;
|
||||
};
|
||||
|
|
|
@ -19,23 +19,6 @@ in {
|
|||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.scrollBar.enable {
|
||||
vim.startPlugins = ["scrollbar-nvim"];
|
||||
vim.pluginRC.scrollBar = entryAnywhere ''
|
||||
require('scrollbar').setup{
|
||||
excluded_filetypes = {
|
||||
'prompt',
|
||||
'TelescopePrompt',
|
||||
'noice',
|
||||
'NvimTree',
|
||||
'alpha',
|
||||
'notify',
|
||||
'Navbuddy'
|
||||
},
|
||||
}
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.smoothScroll.enable {
|
||||
vim.startPlugins = ["cinnamon-nvim"];
|
||||
vim.pluginRC.smoothScroll = entryAnywhere ''
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
imports = [
|
||||
./fidget
|
||||
./nvim-cursorline
|
||||
./nvim-scrollbar
|
||||
./nvim-web-devicons
|
||||
|
||||
./config.nix
|
||||
|
|
21
modules/plugins/visuals/nvim-scrollbar/config.nix
Normal file
21
modules/plugins/visuals/nvim-scrollbar/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.nvim-scrollbar;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["nvim-scrollbar"];
|
||||
|
||||
pluginRC.cursorline = entryAnywhere ''
|
||||
require("scrollbar").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/visuals/nvim-scrollbar/default.nix
Normal file
6
modules/plugins/visuals/nvim-scrollbar/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./scrollbar-nvim.nix
|
||||
];
|
||||
}
|
21
modules/plugins/visuals/nvim-scrollbar/scrollbar-nvim.nix
Normal file
21
modules/plugins/visuals/nvim-scrollbar/scrollbar-nvim.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) listOf str;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "visuals" "scrollBar"] ["vim" "visuals" "nvim-scrollbar"])
|
||||
];
|
||||
|
||||
options.vim.visuals.nvim-scrollbar = {
|
||||
enable = mkEnableOption "extensible Neovim Scrollbar [nvim-scrollbar]";
|
||||
setupOpts = mkPluginSetupOption "scrollbar-nvim" {
|
||||
excluded_filetypes = mkOption {
|
||||
type = listOf str;
|
||||
default = ["prompt" "TelescopePrompt" "noice" "noice" "NvimTree" "neo-tree" "alpha" "notify" "Navbuddy"];
|
||||
description = "Filetypes to hide the scrollbar on";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue