Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim diff highlighting #90

Open
opennomad opened this issue Sep 15, 2020 · 3 comments · May be fixed by #131
Open

vim diff highlighting #90

opennomad opened this issue Sep 15, 2020 · 3 comments · May be fixed by #131

Comments

@opennomad
Copy link

I love the themes, but in vim, the diff highlighting could be more clear. I did some experimenting and added a gray color and used that along with red and green to highlight like this:
image

let s:gray        = { "gui": "#bec1c7", "cterm": "250" }
call s:h("DiffAdd", "", s:green, "")
call s:h("DiffChange", "", s:gray, "")
call s:h("DiffDelete", "", s:red, "")
call s:h("DiffText", s:purple, s:gray, "italic")

image

let s:gray        = { "gui": "#464a51", "cterm": "240" }
call s:h("DiffAdd", "", s:green, "")
call s:h("DiffChange", "", s:gray, "")
call s:h("DiffDelete", "", s:red, "")
call s:h("DiffText", s:purple, s:gray, "italic")

Not sure if this is something you would entertain as a PR or if there is a good way to augment your wonderful work in a way that doesn't trample on it.

@sonph
Copy link
Owner

sonph commented Oct 14, 2020

Thanks for the idea, let me look into this a bit. To be honest to my eyes the contrast in the screenshots doesn't look very good. The combination of green background and gray text is pretty hard to read. It doesn't look like this screenshot, perhaps you're using slightly different colors 🤔

@opennomad
Copy link
Author

Much appreciated. TBH. I don't really love the look either and could likely be improved, but I got frustrated and moved on with "good enough for now". The idea came from how Meld does it and it seems like a great way to highlight the differences

image

@BBaoVanC BBaoVanC linked a pull request Mar 27, 2022 that will close this issue
@ianchanning
Copy link

If I compare solarized light compared to onehalf it is much easier to spot the lines that have changed because there is a background colour applied to the rows that change, otherwise its really hard to spot the differences.

Here for example is a diff with onehalflight:

image

See if you can spot all the differences.

Here is the same with solarized light:

Screenshot from 2023-05-11 18-20-18

I get the idea with onehalf is supposed to be very minimalist, but even just the slightest hint of which line changed would make a massive difference. Something like the background grey colour that is used when the cursor is on a variable would be perfect:

image

dwettstein added a commit to dwettstein/onehalf that referenced this issue Nov 13, 2023
Fixes sonph#90

* mr-upstream-131:
  Add config for onehalflight too
  Add vim-signify settings
  Highlighting in diffs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants