From 7d18194a22325f212e17eb876d9c00afcc434113 Mon Sep 17 00:00:00 2001 From: FKouhai Date: Sun, 4 May 2025 15:19:31 +0200 Subject: [PATCH] colorschemes/kanagawa-paper: init --- plugins/colorschemes/kanagawa-paper.nix | 55 +++++++++++++++++++ plugins/default.nix | 1 + .../plugins/colorschemes/kanagawa-paper.nix | 48 ++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 plugins/colorschemes/kanagawa-paper.nix create mode 100644 tests/test-sources/plugins/colorschemes/kanagawa-paper.nix diff --git a/plugins/colorschemes/kanagawa-paper.nix b/plugins/colorschemes/kanagawa-paper.nix new file mode 100644 index 00000000..4978e4d0 --- /dev/null +++ b/plugins/colorschemes/kanagawa-paper.nix @@ -0,0 +1,55 @@ +{ + lib, + ... +}: +lib.nixvim.plugins.mkNeovimPlugin { + name = "kanagawa-paper"; + isColorscheme = true; + packPathName = "kanagawa-paper.nvim"; + package = "kanagawa-paper-nvim"; + + description = '' + You can select the theme in two ways: + - Set `colorschemes.kanagawa-paper.settings.theme` AND explicitly unset `vim.o.background` (i.e. `opts.background = ""`). + - Set `colorschemes.kanagawa-paper.settings.background` (the active theme will depend on the value of `vim.o.background`). + ''; + + maintainers = [ lib.maintainers.FKouhai ]; + + settingsExample = { + background = "dark"; + cache = false; + colors = { + palette = { }; + theme = { + ink = { }; + canvas = { }; + }; + }; + + undercurl = true; + styles = { + comments = { + italic = true; + }; + functions = { + italic = true; + }; + keywords = { + italic = true; + }; + statement_style = { + bold = true; + }; + }; + + transparent = true; + auto_plugins = false; + dim_inactive = false; + gutter = false; + compile = false; + overrides = lib.nixvim.nestedLiteralLua "function(colors) return {} end"; + terminal_colors = false; + theme = "ink"; + }; +} diff --git a/plugins/default.nix b/plugins/default.nix index fde3fe70..b40e69c0 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -12,6 +12,7 @@ ./colorschemes/github-theme.nix ./colorschemes/gruvbox.nix ./colorschemes/kanagawa.nix + ./colorschemes/kanagawa-paper.nix ./colorschemes/melange.nix ./colorschemes/modus.nix ./colorschemes/monokai-pro.nix diff --git a/tests/test-sources/plugins/colorschemes/kanagawa-paper.nix b/tests/test-sources/plugins/colorschemes/kanagawa-paper.nix new file mode 100644 index 00000000..5889e234 --- /dev/null +++ b/tests/test-sources/plugins/colorschemes/kanagawa-paper.nix @@ -0,0 +1,48 @@ +{ + empty = { + # disable test due to this error: ERROR: Cache updated: kanagawa-paper-plugins.json + # initial assessment was to disable cache via plugin config but that did not work + # then disabled the plugins loading on auto and that did not work either, might be a runtime setup + test.runNvim = false; + colorschemes.kanagawa-paper.enable = true; + }; + + defaults = { + test.runNvim = false; + colorschemes.kanagawa-paper = { + enable = true; + + settings = { + cache = false; + colors = { + palette = { }; + theme = { + ink = { }; + canvas = { }; + }; + }; + undercurl = true; + styles = { + comments = { + italic = true; + }; + functions = { + italic = true; + }; + keywords = { + italic = true; + }; + statement_style = { + bold = true; + }; + }; + transparent = true; + auto_plugins = false; + dim_inactive = false; + terminal_colors = false; + gutter = false; + theme = "ink"; + }; + }; + }; +}