mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-06 02:49:33 +00:00
ui/modes: rename to 'modes-nvim'; convert to freeform setupOpts
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ic9ce8702bca16c6a2f10bd35c9b194a36a6a6964
This commit is contained in:
parent
f298adc193
commit
228d6490c3
4 changed files with 48 additions and 55 deletions
20
modules/plugins/ui/modes-nvim/config.nix
Normal file
20
modules/plugins/ui/modes-nvim/config.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.ui.modes-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["modes-nvim"];
|
||||
pluginRC.modes-nvim = entryAnywhere ''
|
||||
require('modes').setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/plugins/ui/modes-nvim/default.nix
Normal file
6
modules/plugins/ui/modes-nvim/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./modes.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
42
modules/plugins/ui/modes-nvim/modes-nvim.nix
Normal file
42
modules/plugins/ui/modes-nvim/modes-nvim.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) listOf bool either str float;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||
in {
|
||||
options.vim.ui.modes-nvim = {
|
||||
enable = mkEnableOption "prismatic line decorations for Neovim [modes.nvim]";
|
||||
|
||||
setupOpts = mkPluginSetupOption "modes.nvim" {
|
||||
set_cursorline = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable nable cursorline initially, and disable cursorline
|
||||
for inactive windows or ignored filetypes.
|
||||
'';
|
||||
};
|
||||
|
||||
line_opacity = {
|
||||
visual = mkOption {
|
||||
type = float;
|
||||
default = 0.15;
|
||||
example = 0.0;
|
||||
description = "Opacity for cursorline and number background";
|
||||
};
|
||||
};
|
||||
|
||||
ignore = mkOption {
|
||||
type = listOf (either str luaInline);
|
||||
default = ["NvimTree" "TelescopePrompt" "!minifiles"];
|
||||
description = ''
|
||||
Disable modes highlights for specified filetypes or enable with
|
||||
prefix "!" if otherwise disabled.
|
||||
|
||||
Can also be a function that returns a boolean value that disables modes
|
||||
highlights when `true`. Use `lib.generators.mkLuaInline` if using a Lua
|
||||
function.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue