Your comparison fails because of a space, not because of this. This is because when you use the iwhite parameter, in the background, vimdiff runs diff -b , which is more limiting on how it compares spaces than what you are looking for. More specifically, the -b option ignores differences in the number of spaces where spaces already exist . In your example, i0 = r0; marked as different from I0=R0; , because in it there are no spaces between characters, and the other is not.
According to the vimdiff documentation, you can override the default behavior of the iwhite parameter by setting diffexpr to a non-empty value. The diff flag you are interested in is --ignore-all-space , which is more flexible regarding spaces. You can change diffexpr in vimdiff to use this option instead of the -b option by default:
set diffexpr=MyDiff() function MyDiff() let opt = "" if &diffopt =~ "icase" let opt = opt . "-i " endif if &diffopt =~ "iwhite" let opt = opt . "--ignore-all-space " endif silent execute "!diff -a --binary " . opt . v:fname_in . " " . v:fname_new . \ " > " . v:fname_out endfunction
See the documentation for more details:
http://vimdoc.sourceforge.net/htmldoc/options.html#%27diffopt%27
Mansoor siddiqui
source share