onehalf
onehalf copied to clipboard
vim diff highlighting
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:
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")
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.
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 🤔
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
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:
See if you can spot all the differences.
Here is the same with solarized light:
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: