onehalf icon indicating copy to clipboard operation
onehalf copied to clipboard

vim diff highlighting

Open opennomad opened this issue 3 years ago • 3 comments

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.

opennomad avatar Sep 15 '20 16:09 opennomad

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 🤔

sonph avatar Oct 14 '20 07:10 sonph

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

opennomad avatar Oct 14 '20 13:10 opennomad

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

ianchanning avatar May 11 '23 16:05 ianchanning