sonph / onehalf

Clean, vibrant and pleasing color schemes for Vim, Sublime Text, iTerm, gnome-terminal and more.
MIT License
1.78k stars 236 forks source link

vim diff highlighting #90

Open opennomad opened 3 years ago

opennomad commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

ianchanning commented 1 year ago

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