When diffing two files in vim (e.g. vim -d file1 file2), I want all whitespace to be ignored.
I almost achieved this by following the advice of Adam Katz in this question: Is there a way to configure vimdiff to ignore ALL whitespaces?
That advice causes the diff command to get the -w option, so that it doesn't include lines with only whitespace differences in the results.
If there's a line with both whitespace differences and non-whitespaces differences, then these are correctly returned by diff. But vim highlights the whitespace as a difference too.
E.g. If the two lines being diffed are:
File 1: a,b,c,d
File 2: a, b, c, e
Then the highlighted diff will be b, c, e instead of my desired e.
Is there any way to tell vim to ignore whitespace in its highlighting process?
I'm using vim 7.3 (gvim).
diffoperates on lines, not characters or words, so-band-wdetermine which lines to ignore. If a line is not ignored, which is the case whenever non-whitespace changes are involved (unless you ignore case or explicitly ignore lines matching some regex),diffwill always output something like this:Altering
diffoptor evendiffexpronly affects how Vim invokesdiff, not how it then processes the diff it receives. Since neither-bnor-wwill change the above diff, Vim will consequently display the same result. Thus what you're looking for is a way to change how exactly Vim highlights the diff it receives, which I don't believe is possible.