mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-06 18:57:17 +00:00
modules: start breaking down core modules; simplify tree structure
This commit is contained in:
parent
4703ed7731
commit
370913e827
242 changed files with 178 additions and 124 deletions
30
modules/plugins/ui/modes/config.nix
Normal file
30
modules/plugins/ui/modes/config.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim boolToString;
|
||||
|
||||
cfg = config.vim.ui.modes-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"modes-nvim"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.modes-nvim = nvim.dag.entryAnywhere ''
|
||||
require('modes').setup({
|
||||
set_cursorline = ${boolToString cfg.setCursorline},
|
||||
line_opacity = {
|
||||
visual = 0,
|
||||
},
|
||||
colors = {
|
||||
copy = "${toString cfg.colors.copy}",
|
||||
delete = "${toString cfg.colors.delete}",
|
||||
insert = "${toString cfg.colors.insert}",
|
||||
visual = "${toString cfg.colors.visual}",
|
||||
},
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
||||
6
modules/plugins/ui/modes/default.nix
Normal file
6
modules/plugins/ui/modes/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./modes.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
36
modules/plugins/ui/modes/modes.nix
Normal file
36
modules/plugins/ui/modes/modes.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
in {
|
||||
options.vim.ui.modes-nvim = {
|
||||
enable = mkEnableOption "modes.nvim's prismatic line decorations";
|
||||
|
||||
setCursorline = mkOption {
|
||||
type = types.bool;
|
||||
description = "Set a colored cursorline on current line";
|
||||
default = false; # looks ugly, disabled by default
|
||||
};
|
||||
|
||||
colors = {
|
||||
copy = mkOption {
|
||||
type = types.str;
|
||||
description = "The #RRGGBB color code for the visual mode highlights";
|
||||
default = "#f5c359";
|
||||
};
|
||||
delete = mkOption {
|
||||
type = types.str;
|
||||
description = "The #RRGGBB color code for the visual mode highlights";
|
||||
default = "#c75c6a";
|
||||
};
|
||||
insert = mkOption {
|
||||
type = types.str;
|
||||
description = "The #RRGGBB color code for the visual mode highlights";
|
||||
default = "#78ccc5";
|
||||
};
|
||||
visual = mkOption {
|
||||
type = types.str;
|
||||
description = "The #RRGGBB color code for the visual mode highlights";
|
||||
default = "#9745be";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue