-
When I make a diff of two files using If I execute the same command using VSCode as difftool (i.e. `code --wait --diff $LOCAL $REMOTE), the result matches my expectations and looks like this: Is there a way to achieve the desired look? I would like make removed lines have red background and added lines have green background. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 16 replies
-
Just fix your colorscheme. (Use |
Beta Was this translation helpful? Give feedback.
-
I tried to run
I even tried to upgrade nvim to the nightly version, but result is the same. |
Beta Was this translation helpful? Give feedback.
-
These are not removed lines. They are added lines, so you should see autocmd BufWinEnter * if &diff && argidx() == 0 | setlocal winhighlight=DiffAdd:DiffDelete,DiffDelete:DiffAdd | endif |
Beta Was this translation helpful? Give feedback.
-
I think the question is how diff highlights are computed: comparaison vs before/after The diff in (n)vim shows you the difference compared to the other file. So the left file has 1 added line (in green) "compared to the right file", and the right file has 1 removed line "compared to the left file". But (n)vim doesn't have a concept of the 'current' file. In git / vscode /.. it has this distinction of the 'current' file (right) and what it was before (left). |
Beta Was this translation helpful? Give feedback.
These are not removed lines. They are added lines, so you should see
:h hl-DiffAdd
and:h 'winhighlight'
. Try this: