sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.86k stars 105 forks source link

Why I don't have color in diffview #273

Closed LintaoAmons closed 1 year ago

LintaoAmons commented 1 year ago

Help~~

I wonder why I don't have color.

image

I use wezterm

sindrets commented 1 year ago

@LintaoAmons Seems like your color scheme just uses really subtle diff highlighting. You can check your current diff highlights with:

hi DiffAdd | hi DiffDelete | hi DiffChange | hi DiffText

Then you can adjust it however you want with either :h :hi or :h nvim_set_hl().

LintaoAmons commented 1 year ago

Can you share the output of your hi DiffAdd | hi DiffDelete | hi DiffChange | hi DiffText? I want use your color settings

sindrets commented 1 year ago

You want colors that are appropriate for your color scheme. My diff highlights will be wrong for your color scheme. The way I go about setting up diff highlights is rather involved.

But the basic gist is that you want to pick some appropriate colors for additions, deletions and modifications, and then you want to blend those colors with the background color of your current color scheme in order to get the transparent overlay look (as nvim doesn't actually support transparent colors for highlights, so we emulate the look using blending).

So again: these colors are dynamically generated, and thus they're different for each color scheme I use. They most likely won't be right for your color scheme. Regardless, here you go:

:hi DiffAdd | hi DiffDelete | hi DiffChange | hi DiffText
DiffAdd        xxx guibg=#313a40
DiffDelete     xxx guibg=#3e2b40
                   links to Comment
DiffChange     xxx guibg=#2e324b
DiffText       xxx guibg=#414868
LintaoAmons commented 1 year ago

Thanks for your throughly explaination