Skip to content

Commit

Permalink
Fix gruvbox diff colors
Browse files Browse the repository at this point in the history
  • Loading branch information
thallada committed Mar 23, 2023
1 parent 223ae8d commit a61afc5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
16 changes: 16 additions & 0 deletions after/plugin/gruvbox.lua
Original file line number Diff line number Diff line change
@@ -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 }
)
14 changes: 8 additions & 6 deletions lua/install-plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,6 @@ return require('packer').startup(function(use)
}
use 'nvim-telescope/telescope-ui-select.nvim'
use 'nvim-telescope/telescope-project.nvim'
use {
'ellisonleao/gruvbox.nvim',
config = function()
require('plugins.gruvbox')
end,
}
use 'NLKNguyen/papercolor-theme'
use {
'akinsho/toggleterm.nvim',
Expand Down Expand Up @@ -447,7 +441,15 @@ return require('packer').startup(function(use)
require('plugins.which-key-nvim')
end
}
use {
'ellisonleao/gruvbox.nvim',
config = function()
require('plugins.gruvbox')
end,
}
use 'eandrju/cellular-automaton.nvim'
use 'nyoom-engineering/oxocarbon.nvim'
use 'folke/tokyonight.nvim'

-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
Expand Down
10 changes: 0 additions & 10 deletions lua/plugins/gruvbox.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local colors = require("gruvbox.palette").colors;

require("gruvbox").setup({
undercurl = true,
underline = true,
Expand Down Expand Up @@ -36,11 +34,3 @@ require("gruvbox").setup({
}
})
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

0 comments on commit a61afc5

Please sign in to comment.