From 28187c3b8f34c0912d9f8ce5f74f415a6b77a1c2 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 26 Oct 2023 12:50:59 +0000 Subject: [PATCH] overlays: add 'gruvbox-nvim-better-diff' I dislike the new style of diff [1]. After somebody wrote a patch [2] I finally started experimenting with what looked best to me. This is using the old vibrant colours, which I like better. And avoids using `reverse = true` to not break high-lighting during visual selection. This is using an overlay as it is _much_ easier to refer to the internal colours in a `dark`/`light` agnostic way that way instead of the intended "use the palette way" (due to breaking changes in [3] which, incidentally, is the MR which changed diff high-lighting). [1]: https://github.com/ellisonleao/gruvbox.nvim/issues/290 [2]: https://github.com/ellisonleao/gruvbox.nvim/pull/291 [3]: https://github.com/ellisonleao/gruvbox.nvim/pull/280 --- .../gruvbox-nvim-better-diff/colours.patch | 28 +++++++++++++++++++ overlays/gruvbox-nvim-better-diff/default.nix | 4 +++ .../gruvbox-nvim-better-diff/generated.nix | 24 ++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 overlays/gruvbox-nvim-better-diff/colours.patch create mode 100644 overlays/gruvbox-nvim-better-diff/default.nix create mode 100644 overlays/gruvbox-nvim-better-diff/generated.nix diff --git a/overlays/gruvbox-nvim-better-diff/colours.patch b/overlays/gruvbox-nvim-better-diff/colours.patch new file mode 100644 index 00000000..5b0d61aa --- /dev/null +++ b/overlays/gruvbox-nvim-better-diff/colours.patch @@ -0,0 +1,28 @@ +From 416b3c9c5e783d173ac0fd5310a76c1b144b92c1 Mon Sep 17 00:00:00 2001 +From: eeeXun +Date: Thu, 19 Oct 2023 02:34:12 +0800 +Subject: Use better diff colours + +--- + README.md | 3 ++- + lua/gruvbox.lua | 7 ++++--- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/lua/gruvbox.lua b/lua/gruvbox.lua +index ceba0735..a319fc6a 100644 +--- a/lua/gruvbox.lua ++++ b/lua/gruvbox.lua +@@ -360,9 +361,9 @@ local function get_groups() + PmenuSel = { fg = colors.bg2, bg = colors.blue, bold = config.bold }, + PmenuSbar = { bg = colors.bg2 }, + PmenuThumb = { bg = colors.bg4 }, +- DiffDelete = { bg = colors.dark_red }, +- DiffAdd = { bg = colors.dark_green }, +- DiffChange = { bg = colors.dark_aqua }, +- DiffText = { bg = colors.yellow, fg = colors.bg0 }, ++ DiffDelete = { fg = colors.red }, ++ DiffAdd = { fg = colors.green }, ++ DiffChange = { fg = colors.aqua }, ++ DiffText = { fg = colors.yellow, bg = colors.bg0 }, + SpellCap = { link = "GruvboxBlueUnderline" }, + SpellBad = { link = "GruvboxRedUnderline" }, diff --git a/overlays/gruvbox-nvim-better-diff/default.nix b/overlays/gruvbox-nvim-better-diff/default.nix new file mode 100644 index 00000000..832e71de --- /dev/null +++ b/overlays/gruvbox-nvim-better-diff/default.nix @@ -0,0 +1,4 @@ +self: prev: +{ + vimPlugins = prev.vimPlugins.extend (self.callPackage ./generated.nix { }); +} diff --git a/overlays/gruvbox-nvim-better-diff/generated.nix b/overlays/gruvbox-nvim-better-diff/generated.nix new file mode 100644 index 00000000..50ea4ad4 --- /dev/null +++ b/overlays/gruvbox-nvim-better-diff/generated.nix @@ -0,0 +1,24 @@ +{ vimUtils, fetchFromGitHub }: + +_final: _prev: { + gruvbox-nvim = vimUtils.buildVimPlugin { + pname = "gruvbox.nvim"; + version = "2023-10-07"; + + src = fetchFromGitHub { + owner = "ellisonleao"; + repo = "gruvbox.nvim"; + rev = "477c62493c82684ed510c4f70eaf83802e398898"; + sha256 = "0250c24c6n6yri48l288irdawhqs16qna3y74rdkgjd2jvh66vdm"; + }; + + patches = [ + # Inspired by https://github.com/ellisonleao/gruvbox.nvim/pull/291 + ./colours.patch + ]; + + meta = { + homepage = "https://github.com/ellisonleao/gruvbox.nvim/"; + }; + }; +}