mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
colorschemes/dracula: add plugin + test (#583)
This commit is contained in:
parent
0c161811aa
commit
9e6892e839
3 changed files with 103 additions and 0 deletions
83
plugins/colorschemes/dracula.nix
Normal file
83
plugins/colorschemes/dracula.nix
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.colorschemes.dracula;
|
||||||
|
helpers = import ../helpers.nix {inherit lib;};
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
colorschemes.dracula = {
|
||||||
|
enable = mkEnableOption "dracula";
|
||||||
|
|
||||||
|
package = helpers.mkPackageOption "dracula" pkgs.vimPlugins.dracula-vim;
|
||||||
|
|
||||||
|
bold = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Include bold attributes in highlighting";
|
||||||
|
};
|
||||||
|
italic = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Include italic attributes in highlighting";
|
||||||
|
};
|
||||||
|
underline = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Include underline attributes in highlighting";
|
||||||
|
};
|
||||||
|
undercurl = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Include undercurl attributes in highlighting (only if underline enabled)";
|
||||||
|
};
|
||||||
|
|
||||||
|
fullSpecialAttrsSupport = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Explicitly declare full support for special attributes. On terminal emulators, set to 1 to allow underline/undercurl highlights without changing the foreground color";
|
||||||
|
};
|
||||||
|
|
||||||
|
highContrastDiff = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Use high-contrast color when in diff mode";
|
||||||
|
};
|
||||||
|
|
||||||
|
inverse = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Include inverse attributes in highlighting";
|
||||||
|
};
|
||||||
|
|
||||||
|
colorterm = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Include background fill colors";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
colorscheme = "dracula";
|
||||||
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
dracula_bold = mkIf (!cfg.bold) 0;
|
||||||
|
dracula_italic = mkIf (!cfg.italic) 0;
|
||||||
|
dracula_underline = mkIf (!cfg.underline) 0;
|
||||||
|
dracula_undercurl = mkIf (!cfg.undercurl) 0;
|
||||||
|
dracula_full_special_attrs_support = mkIf cfg.fullSpecialAttrsSupport 1;
|
||||||
|
dracula_high_contrast_diff = mkIf cfg.highContrastDiff 1;
|
||||||
|
dracula_inverse = mkIf (!cfg.inverse) 0;
|
||||||
|
dracula_colorterm = mkIf (!cfg.colorterm) 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
options = {
|
||||||
|
termguicolors = mkDefault true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
./colorschemes/ayu.nix
|
./colorschemes/ayu.nix
|
||||||
./colorschemes/base16.nix
|
./colorschemes/base16.nix
|
||||||
|
./colorschemes/dracula.nix
|
||||||
./colorschemes/gruvbox.nix
|
./colorschemes/gruvbox.nix
|
||||||
./colorschemes/kanagawa.nix
|
./colorschemes/kanagawa.nix
|
||||||
./colorschemes/nord.nix
|
./colorschemes/nord.nix
|
||||||
|
|
19
tests/test-sources/plugins/colorschemes/dracula.nix
Normal file
19
tests/test-sources/plugins/colorschemes/dracula.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
colorschemes.dracula.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
colorschemes.dracula = {
|
||||||
|
enable = true;
|
||||||
|
bold = true;
|
||||||
|
italic = true;
|
||||||
|
underline = true;
|
||||||
|
undercurl = true;
|
||||||
|
fullSpecialAttrsSupport = false;
|
||||||
|
highContrastDiff = false;
|
||||||
|
inverse = true;
|
||||||
|
colorterm = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue