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 Dec 1, 2023
1 parent 76d8cc8 commit 603e33e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions lua/plugins/diffview.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local actions = require("diffview.actions")

require("diffview").setup({
enhanced_diff_hl = true,
keymaps = {
view = {
["gq"] = "<Cmd>DiffviewClose<CR>",
Expand Down
21 changes: 19 additions & 2 deletions lua/plugins/gruvbox.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local colors = require("gruvbox.palette").colors;

require("gruvbox").setup({
undercurl = true,
underline = true,
Expand All @@ -22,8 +24,23 @@ require("gruvbox").setup({
dark1 = '#242424',
},
overrides = {
Pmenu = { bg = '#222222'}
Pmenu = { bg = '#222222'},
GruvboxAquaSign = { bg = "NONE" },
GruvboxBlueSign = { bg = "NONE" },
GruvboxGreenSign = { bg = "NONE" },
GruvboxOrangeSign = { bg = "NONE" },
GruvboxPurpleSign = { bg = "NONE" },
GruvboxRedSign = { bg = "NONE" },
GruvboxYellowSign = { bg = "NONE" },
SignColumn = { bg = "NONE" },
}
})
vim.o.background = "dark"
vim.api.nvim_command([[colorscheme gruvbox]])

-- 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
2 changes: 2 additions & 0 deletions lua/user/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,5 @@ vim.api.nvim_create_autocmd('TextYankPost', {
})

vim.opt.fillchars:append { diff = "" }

vim.api.nvim_command([[colorscheme gruvbox]])

0 comments on commit 603e33e

Please sign in to comment.