mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
colorizer: move back to setupOpts
This commit is contained in:
parent
981fe07075
commit
82e92a56da
2 changed files with 49 additions and 15 deletions
|
@ -4,8 +4,9 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) attrsOf enum nullOr submodule bool;
|
||||
inherit (lib.types) attrsOf enum nullOr submodule bool str;
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
|
||||
settingSubmodule = submodule {
|
||||
options = {
|
||||
|
@ -33,6 +34,12 @@
|
|||
type = nullOr bool;
|
||||
};
|
||||
|
||||
AARRGGBB = mkOption {
|
||||
description = "Colorize 0xAARRGGBB hex codes";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
rgb_fn = mkOption {
|
||||
description = "Colorize CSS rgb() and rgba() functions";
|
||||
default = null;
|
||||
|
@ -57,11 +64,35 @@
|
|||
type = nullOr bool;
|
||||
};
|
||||
|
||||
tailwind = mkOption {
|
||||
description = "Enable tailwind colors";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
sass = mkOption {
|
||||
description = "Enable sass colors";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
virtualtext = mkOption {
|
||||
description = "String to display as virtualtext";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
mode = mkOption {
|
||||
description = "Set the display mode";
|
||||
type = nullOr (enum ["foreground" "background"]);
|
||||
default = null;
|
||||
};
|
||||
|
||||
always_update = mkOption {
|
||||
description = "Update color values even if buffer is not focused. Example use: cmp_menu, cmp_docs";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
@ -73,21 +104,24 @@ in {
|
|||
options.vim.ui.colorizer = {
|
||||
enable = mkEnableOption "color highlighting [nvim-colorizer.lua]";
|
||||
|
||||
defaultOptions = mkOption {
|
||||
setupOpts = mkPluginSetupOption "colorizer" {
|
||||
filetypes = mkOption {
|
||||
description = ''
|
||||
Default options that apply to all filetypes. Filetype specific settings from
|
||||
[filetypeSettings](#opt-vim.ui.colorizer.filetypeSettings) take precedence.
|
||||
'';
|
||||
default = {};
|
||||
type = settingSubmodule;
|
||||
};
|
||||
Filetypes to enable on and their option overrides.
|
||||
|
||||
filetypeOptions = mkOption {
|
||||
description = "Filetype specific settings";
|
||||
The special filetype "*" means enable on all filetypes.
|
||||
'';
|
||||
default = {};
|
||||
type = submodule {
|
||||
freeformType = attrsOf settingSubmodule;
|
||||
};
|
||||
};
|
||||
|
||||
user_default_options = mkOption {
|
||||
description = "Default options";
|
||||
default = {};
|
||||
type = settingSubmodule;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ in {
|
|||
];
|
||||
|
||||
vim.luaConfigRC.colorizer = entryAnywhere ''
|
||||
require('colorizer').setup(${toLuaObject cfg.filetypeOptions}, ${toLuaObject cfg.defaultOptions})
|
||||
require('colorizer').setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue