Fix gruvbox diff colors

See:
https://github.com/ellisonleao/gruvbox.nvim/issues/105#issuecomment-1480547367
This commit is contained in:
Tyler Hallada 2023-03-22 23:30:44 -04:00
parent 223ae8d81b
commit a61afc55f6
3 changed files with 24 additions and 16 deletions

16
after/plugin/gruvbox.lua Normal file
View File

@ -0,0 +1,16 @@
local colors = require("gruvbox.palette").colors;
function FixGruvbox()
vim.api.nvim_set_hl(0, 'DiffviewDiffAddAsDelete', { bg = "#431313" })
vim.api.nvim_set_hl(0, 'DiffDelete', { bg = "none", fg = colors.dark2 })
vim.api.nvim_set_hl(0, 'DiffviewDiffDelete', { bg = "none", fg = colors.dark2 })
vim.api.nvim_set_hl(0, 'DiffAdd', { bg = "#142a03" }) -- #122f2f
vim.api.nvim_set_hl(0, 'DiffChange', { bg = "#3B3307" })
vim.api.nvim_set_hl(0, 'DiffText', { bg = "#4D520D" }) -- #2f3f5c
end
FixGruvbox()
vim.api.nvim_create_autocmd(
"ColorScheme",
{ pattern = { "gruvbox" }, callback = FixGruvbox }
)

View File

@ -226,12 +226,6 @@ return require('packer').startup(function(use)
} }
use 'nvim-telescope/telescope-ui-select.nvim' use 'nvim-telescope/telescope-ui-select.nvim'
use 'nvim-telescope/telescope-project.nvim' use 'nvim-telescope/telescope-project.nvim'
use {
'ellisonleao/gruvbox.nvim',
config = function()
require('plugins.gruvbox')
end,
}
use 'NLKNguyen/papercolor-theme' use 'NLKNguyen/papercolor-theme'
use { use {
'akinsho/toggleterm.nvim', 'akinsho/toggleterm.nvim',
@ -447,7 +441,15 @@ return require('packer').startup(function(use)
require('plugins.which-key-nvim') require('plugins.which-key-nvim')
end end
} }
use {
'ellisonleao/gruvbox.nvim',
config = function()
require('plugins.gruvbox')
end,
}
use 'eandrju/cellular-automaton.nvim' use 'eandrju/cellular-automaton.nvim'
use 'nyoom-engineering/oxocarbon.nvim'
use 'folke/tokyonight.nvim'
-- Automatically set up your configuration after cloning packer.nvim -- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins -- Put this at the end after all plugins

View File

@ -1,5 +1,3 @@
local colors = require("gruvbox.palette").colors;
require("gruvbox").setup({ require("gruvbox").setup({
undercurl = true, undercurl = true,
underline = true, underline = true,
@ -36,11 +34,3 @@ require("gruvbox").setup({
} }
}) })
vim.o.background = "dark" vim.o.background = "dark"
-- TODO: how to apply this when colorscheme changes?
vim.api.nvim_set_hl(0, 'DiffDelete', { bg = "none", fg = colors.dark2 })
vim.api.nvim_set_hl(0, 'DiffviewDiffDelete', { bg = "none", fg = colors.dark2 })
vim.api.nvim_set_hl(0, 'DiffviewDiffAddAsDelete', { bg = "#370000" })
vim.api.nvim_set_hl(0, 'DiffAdd', { bg = "#393400" }) -- #122f2f
vim.api.nvim_set_hl(0, 'DiffChange', { bg = "#222a36" })
vim.api.nvim_set_hl(0, 'DiffText', { bg = "#2f3f5c" }) -- #2f3f5c