Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting doesn't work #17

Open
AnatoleLucet opened this issue Nov 6, 2020 · 10 comments
Open

Highlighting doesn't work #17

AnatoleLucet opened this issue Nov 6, 2020 · 10 comments

Comments

@AnatoleLucet
Copy link

This plugin seems great, but I can't get the highlighting to work.

image
The errors signs are from CoC, I assume this plugin might interfere with it?

Neither the default nor the example in the readme works.
I'm a vim newbie, so I don't really know what info to provide, but feel free to ask me.

@AnatoleLucet
Copy link
Author

AnatoleLucet commented Nov 9, 2020

Fixed it by installing: https://github.com/vim-scripts/guicolorscheme.vim
It doesn't seem to work with every themes though.

@AnatoleLucet
Copy link
Author

Well, I was wrong. It didn't fix it.
it seems like this plugin's highlighting doesn't work with some themes. For example is doesn't work with one dark

@AnatoleLucet AnatoleLucet reopened this Nov 23, 2020
@ranelpadon
Copy link

ranelpadon commented Mar 14, 2021

Highlighting works on my end, and I'm using Neovim and One Dark theme:
Screen Shot 2021-03-15 at 9 16 43 AM

Need to set these though:

" disable the default highlight group
let g:conflict_marker_highlight_group = ''

" Include text after begin and end markers
let g:conflict_marker_begin = '^<<<<<<< .*$'
let g:conflict_marker_end   = '^>>>>>>> .*$'

highlight ConflictMarkerBegin guifg=#e06c75
highlight ConflictMarkerOurs guibg=#2e5049
highlight ConflictMarkerSeparator guifg=#e06c75
highlight ConflictMarkerTheirs guibg=#344f69
highlight ConflictMarkerEnd guifg=#e06c75

@reybeamde
Copy link

reybeamde commented Mar 24, 2021

Also 'NLKNguyen/papercolor-theme' is not working, with ranelpadon seetings. (vim 8.2 and nvim 0.5)

@mosheavni
Copy link

Highlight doesn't work for me either, tried palenight and one-dark,
also added this to vimrc:

highlight ConflictMarkerBegin guifg=#e06c75
highlight ConflictMarkerOurs guibg=#2e5049
highlight ConflictMarkerSeparator guifg=#e06c75
highlight ConflictMarkerTheirs guibg=#344f69
highlight ConflictMarkerEnd guifg=#e06c75

@ranelpadon
Copy link

@reybeamde @mosheavni Make sure that this is set:

let g:conflict_marker_highlight_group = ''

and highlight overrides should come after the colorscheme is loaded/set. Or try to move those overrides at the bottom of your .vimrc or init.vim.

@mosheavni
Copy link

@reybeamde @mosheavni Make sure that this is set:

let g:conflict_marker_highlight_group = ''

and highlight overrides should come after the colorscheme is loaded/set. Or try to move those overrides at the bottom of your .vimrc or init.vim.

ok it's working after moving it after setting the colorscheme, however, why's that?
Why can't this plugin have its own highlight group and just set its own syntax matching and highlights?
Thanks.

@ranelpadon
Copy link

ranelpadon commented Apr 16, 2021

@mosheavni IIRC, based on customizing the highlighting in other Vim plugins, they usually advise to do the override after the colorscheme is loaded since it sets its own highlighting group as well. I think because the last setting/highlighting will win, just like when overriding a variable. Otherwise, the colorscheme will win if you set your custom highlighting too early. Cheers.

@aprowe
Copy link

aprowe commented Nov 17, 2021

I was able to fix highlighting with a timer function to defer the highlighting:

function! HighlightConflictMarker() abort
    highlight ConflictMarkerBegin guibg=#2f7366
    highlight ConflictMarkerOurs guibg=#2e5049
    highlight ConflictMarkerTheirs guibg=#344f69
    highlight ConflictMarkerEnd guibg=#2f628e
    highlight ConflictMarkerCommonAncestorsHunk guibg=#754a81
endfunction
call timer_start(200, { tid -> execute('call HighlightConflictMarker()') })
" OR 
" autocmd VimEnter * call HighlightConflictMarker()

@lytex
Copy link

lytex commented Mar 9, 2022

I got it working using terminal colors instead of gui:

" from https://michurin.github.io/xterm256-color-picker/
highlight ConflictMarkerBegin ctermbg=34 
highlight ConflictMarkerOurs ctermbg=22  
highlight ConflictMarkerTheirs ctermbg=27 
highlight ConflictMarkerEnd ctermbg=39 
highlight ConflictMarkerCommonAncestorsHunk ctermbg=yellow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants