everforest icon indicating copy to clipboard operation
everforest copied to clipboard

Support git-conflict.nvim highlights

Open blackxored opened this issue 1 month ago • 6 comments

I have done the following steps before reporting this issue:

  • [x] I have searched the existing issues
  • [x] I have read the FAQ in the help doc

Operating system/version

macOS Tahoe

Terminal emulator/version

kitty 0.44.0

$TERM environment variable

xterm-kitty

Tmux version

No response

Feature matrix

NVIM v0.11.5 Build type: Release LuaJIT 2.1.1741730670 Run "nvim -V1 -v" for more info

Minimal vimrc that can reproduce this bug.

the placeholder one should work

Steps to reproduce this bug using minimal vimrc

  1. Install https://github.com/akinsho/git-conflict.nvim
  2. Open a file with a merge conflict.
  3. The ours section is unreadable.

Expected behavior

Being readable by default without having to tweak highlights.

Actual behavior

This is more of nice to have / feature request, but it would be nice if Everforest would work with it by default.

EDIT: forgot the screenshot

Image

blackxored avatar Nov 10 '25 23:11 blackxored

That looks truly horrendous 😅 Thanks for reporting 👍

antoineco avatar Nov 11 '25 10:11 antoineco

Before I try this myself, how does it look with this naive customization applied?

-- init.lua (Neovim)

-- Apply custom highlights on colorscheme change.
-- Must be declared before executing ':colorscheme'.
vim.api.nvim_create_autocmd('ColorScheme', {
  group = vim.api.nvim_create_augroup('custom_highlights_everforest', {}),
  pattern = 'everforest',
  command = 'hi link GitConflictAncestor DiffChange |' ..
            'hi link GitConflictIncoming DiffAdd'
})

antoineco avatar Nov 11 '25 21:11 antoineco

GitConflictIncoming links to DiffAdd, looks the same.GitConflictAncestor also looks the same but didn't seem to do anything (I see GitConflictCurrent when I do :Inspect over the first section, but I've no idea what I'm doing).

Image

blackxored avatar Nov 11 '25 22:11 blackxored

My bad. What about this then?

vim.api.nvim_create_autocmd('ColorScheme', {
  group = vim.api.nvim_create_augroup('custom_highlights_everforest', {}),
  pattern = 'everforest',
  command = 'hi link GitConflictCurrent DiffChange'
})

antoineco avatar Nov 11 '25 22:11 antoineco

Image

Looks better, I think DiffText should also work, https://github.com/akinsho/git-conflict.nvim?tab=readme-ov-file#configuration, neither fix the heading though (the aquamarine).

blackxored avatar Nov 11 '25 22:11 blackxored

It's unfortunate that the plugin defaults to DiffText, because GitConflictCurrentLabel is derived from that highlight group by tinting the background color, and Everforest's DiffText background is just too bright in this case:

DiffText GitConflictCurrentLabel

When the plugin is configured with { highlights = { current = 'DiffChange' }} the result looks way nicer, but one shouldn't have to configure a plugin for a specific colorscheme:

The plugin would look better out of the box if it checked GitConflictCurrentLabel first, then fallback to DiffText as a last resort.

In the current state, we can't style GitConflictCurrentLabel like the plugin does without either

  • adding a new color to Everforest's palette.
  • darkening DiffText's background.

None of those are reasonable, especially not for supporting a plugin which was last updated a year ago and is still using a few deprecated APIs.

To avoid having to configure the plugin, the best I can suggest is the autocmd approach, which is the most idiomatic way in (Neo)vim to apply coloscheme specific tweaks. The following overrides look good without degrading the native diff mode, and adapt dynamically to your Everforest configuration:

vim.api.nvim_create_autocmd('ColorScheme', {
  group = vim.api.nvim_create_augroup('custom_highlights_everforest', {}),
  pattern = 'everforest',
  callback = function()
    local config = vim.fn['everforest#get_configuration']()
    local palette = vim.fn['everforest#get_palette'](config.background, config.colors_override)
    local set_hl = vim.fn['everforest#highlight']

    set_hl('DiffText', palette.none, palette.bg_blue)
    set_hl('DiffChange', palette.none, palette.bg3)
  end
})
Image

antoineco avatar Nov 12 '25 18:11 antoineco