0

I am currently using the following lines from this answer in my .vimrc to fix my colorscheme when using vimdiff:

highlight DiffAdd    cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffDelete cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffText   cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red

This works great for ordinary text file diffs. Unfortunately, when this is enabled and I diff two java files, the lines that are added (in the diff) lose their syntax highlighting.

Is there a way to make syntax highlighting run after the lines above, so that I can git reasonable diff highlighting while preserving syntax highlighting?

merlin2011
  • 71,677
  • 44
  • 195
  • 329
  • 2
    Do you need backlighting all the time or just for comparison? [https://vim.fandom.com/wiki/Creating_your_own_syntax_files](https://vim.fandom.com/wiki/Creating_your_own_syntax_files) – Jossnix Jan 19 '21 at 12:55
  • 1
    Only for comparisons. – merlin2011 Jan 19 '21 at 21:19

0 Answers0