mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/rose-pine: add colorscheme + test (#435)
* plugins/rose-pine: add colorscheme & test * Fixed typo in test * Fix invalid option in test * Use inherit instead of cfg.groups in plugins/rose-pine.nix * plugins/rosepine: improved formatting
This commit is contained in:
parent
f5825552e4
commit
136f059405
3 changed files with 106 additions and 0 deletions
54
plugins/colorschemes/rose-pine.nix
Normal file
54
plugins/colorschemes/rose-pine.nix
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
} @ args:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.colorschemes.rose-pine;
|
||||||
|
helpers = import ../helpers.nix args;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
colorschemes.rose-pine = {
|
||||||
|
enable = mkEnableOption "rose-pine";
|
||||||
|
|
||||||
|
package = helpers.mkPackageOption "rose-pine" pkgs.vimPlugins.rose-pine;
|
||||||
|
|
||||||
|
style = helpers.defaultNullOpts.mkEnumFirstDefault ["main" "moon" "dawn"] "Theme style";
|
||||||
|
|
||||||
|
boldVerticalSplit = helpers.defaultNullOpts.mkBool false "Bolds vertical splits";
|
||||||
|
|
||||||
|
dimInactive = helpers.defaultNullOpts.mkBool false "Dims inactive windows";
|
||||||
|
|
||||||
|
disableItalics = helpers.defaultNullOpts.mkBool false "Disables italics";
|
||||||
|
|
||||||
|
groups = helpers.mkNullOrOption types.attrs "rose-pine highlight groups";
|
||||||
|
|
||||||
|
highlightGroups = helpers.mkNullOrOption types.attrs "Custom highlight groups";
|
||||||
|
|
||||||
|
transparentBackground = helpers.defaultNullOpts.mkBool false "Disable setting background";
|
||||||
|
|
||||||
|
transparentFloat = helpers.defaultNullOpts.mkBool false "Disable setting background for floating windows";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
colorscheme = "rose-pine";
|
||||||
|
extraPlugins = [cfg.package];
|
||||||
|
options = {termguicolors = true;};
|
||||||
|
extraConfigLuaPre = let
|
||||||
|
setupOptions = with cfg; {
|
||||||
|
inherit groups;
|
||||||
|
dark_variant = style;
|
||||||
|
bold_vert_split = boldVerticalSplit;
|
||||||
|
disable_background = transparentBackground;
|
||||||
|
disable_float_background = transparentFloat;
|
||||||
|
disable_italics = disableItalics;
|
||||||
|
dim_nc_background = dimInactive;
|
||||||
|
highlight_groups = highlightGroups;
|
||||||
|
};
|
||||||
|
in ''
|
||||||
|
require("rose-pine").setup(${helpers.toLuaObject setupOptions})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -11,6 +11,7 @@
|
||||||
./colorschemes/poimandres.nix
|
./colorschemes/poimandres.nix
|
||||||
./colorschemes/tokyonight.nix
|
./colorschemes/tokyonight.nix
|
||||||
./colorschemes/catppuccin.nix
|
./colorschemes/catppuccin.nix
|
||||||
|
./colorschemes/rose-pine.nix
|
||||||
|
|
||||||
./completion/coq.nix
|
./completion/coq.nix
|
||||||
./completion/coq-thirdparty.nix
|
./completion/coq-thirdparty.nix
|
||||||
|
|
51
tests/test-sources/plugins/colorschemes/rose-pine.nix
Normal file
51
tests/test-sources/plugins/colorschemes/rose-pine.nix
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
colorschemes.rose-pine.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
colorschemes.rose-pine = {
|
||||||
|
enable = true;
|
||||||
|
style = "main";
|
||||||
|
boldVerticalSplit = false;
|
||||||
|
dimInactive = false;
|
||||||
|
disableItalics = false;
|
||||||
|
groups = {
|
||||||
|
background = "base";
|
||||||
|
background_nc = "_experimental_nc";
|
||||||
|
panel = "surface";
|
||||||
|
panel_nc = "base";
|
||||||
|
border = "highlight_med";
|
||||||
|
comment = "muted";
|
||||||
|
link = "iris";
|
||||||
|
punctuation = "subtle";
|
||||||
|
error = "love";
|
||||||
|
hint = "iris";
|
||||||
|
info = "foam";
|
||||||
|
warn = "gold";
|
||||||
|
headings = {
|
||||||
|
h1 = "iris";
|
||||||
|
h2 = "foam";
|
||||||
|
h3 = "rose";
|
||||||
|
h4 = "gold";
|
||||||
|
h5 = "pine";
|
||||||
|
h6 = "foam";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
highlightGroups = {
|
||||||
|
ColorColumn = {bg = "rose";};
|
||||||
|
CursorLine = {
|
||||||
|
bg = "foam";
|
||||||
|
blend = 10;
|
||||||
|
};
|
||||||
|
StatusLine = {
|
||||||
|
fg = "love";
|
||||||
|
bg = "love";
|
||||||
|
blend = 10;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
transparentBackground = false;
|
||||||
|
transparentFloat = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue