Skip to content

Change text color in diff! #985

Answered by fitrh
charlesneimog asked this question in Q&A
Discussion options

You must be logged in to vote

That's because your theme's Diff* highlight group has a background,
you can do something like this

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

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@charlesneimog
Comment options

Answer selected by charlesneimog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants