akinsho / git-conflict.nvim

A plugin to visualise and resolve merge conflicts in neovim
1k stars 35 forks source link

Flag for using the default highlight colours #72

Closed FredrikMorstad closed 7 months ago

FredrikMorstad commented 1 year ago

It would be nice to have an optional flag called something like <bool> default_colors who making the plugin choosing the default colours even if a highlightGroup is detected. I think this should be simple to add as the set_highlights can be changed to:

local function set_highlights(highlights, useDefault)

and then update the assignment of the colours here:

  local current_bg = current_color.background or DEFAULT_CURRENT_BG_COLOR
  local incoming_bg = incoming_color.background or DEFAULT_INCOMING_BG_COLOR
  local ancestor_bg = ancestor_color.background or DEFAULT_ANCESTOR_BG_COLOR
akinsho commented 1 year ago

Hi @FredrikMorstad,

I don't understand why this option would be necessary. It is usually enough to set the value yourself or use the default, why would we need another option.

FredrikMorstad commented 1 year ago

Hi @FredrikMorstad,

I don't understand why this option would be necessary. It is usually enough to set the value yourself or use the default, why would we need another option.

It may be that I have misunderstood the docs, but I did not see a flag for setting the colours directly. For me the plugin looked like this and I was looking for a way to use the default colours without having to find and set them in the setup

Screenshot 2023-10-22 at 22 40 59
akinsho commented 1 year ago

@FredrikMorstad you can create your own highlight group which uses whatever colour you want and pass that to highlights table so you could do. highlight NewColour guibg=#ƒƒƒƒƒƒ and then use highlights = {incoming = "NewColour"} otherwise you can change the base colours in your config. I think both of those solution resolve this problem without a new config being needed