Change text color in diff! #985
Answered
by
fitrh
charlesneimog
asked this question in
Q&A
-
Hi, I am trying to change the color of diff text. I have this: When I use the lua diff section as README. I have this: lualine_b = {
'branch',
{
'diff',
colored = true, -- Displays a colored diff status if set to true
symbols = {added = '+', modified = '~', removed = '-'},
diff_color = {
-- Same color values as the general color option can be used here.
added = 'DiffAdd', -- Changes the diff's added color
modified = 'DiffChange', -- Changes the diff's modified color
removed = 'DiffDelete', -- Changes the diff's removed color you
},
},
There is some way to just change the text, without the background changes? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
fitrh
Mar 3, 2023
Replies: 1 comment 1 reply
-
That's because your theme's for _, kind in ipairs({ 'Add', 'Change', 'Delete' }) do
local group = 'Diff' .. kind
local bg = vim.api.nvim_get_hl_by_name(group, true)['background']
vim.api.nvim_set_hl(0, group, { fg = string.format('%06X', bg) })
end |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
charlesneimog
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's because your theme's
Diff*
highlight group has a background,you can do something like this