5

I have set up 'vimdiff' as my default svn-diff tool by adding below line to ~/.subversion/config

diff-cmd = /home/ravikirn/svndiff/diffwrap.sh

diffwrap.sh

!/bin/sh

# Configure your favorite diff program here.
DIFF="/usr/local/bin/vimdiff"

# Subversion provides the paths we need as the sixth and seventh
# parameters.
LEFT=${6}
RIGHT=${7}

# Call the diff command (change the following line to make sense for 
# your merge program).

$DIFF $LEFT $RIGHT

But, vimdiff puts all ugly colors to display the diff. I have black background and green font color, how can I modify vimdiff to show custom colors for this diff ? I want a more pleasant experience with the same.

1 Answer 1

11

You can define colors in your colorscheme file. There are a couple of group highlights for vimdiff:

DiffAdd     diff mode: Added line
DiffChange  diff mode: Changed line
DiffDelete  diff mode: Deleted line
DiffText    diff mode: Changed text within a changed line

Before you edit your colorscheme file, you can start experiment, by defining colors in a vim session, by doing like :

:highlight DiffDelete ctermfg=black ctermbg=yellow 

After you found your colors, place them in your colroscheme, and be happy. Or just place your highlight declarations inside "vimrc". Depends what you prefer.

Btw, you also can switch your colorscheme when doing diff. For example if you prefer different color when diffing. This is done by this :

if &diff
    colorscheme some_other_scheme
endif

Good luck with experiments

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot, exactly what I was looking for ! I will experiment on this over the weekend.
link broken, spam ahead!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.