When using vimdiff, it highlights the differing portion of the lines in a "greedy" fashion. That is, when comparing two lines:
Left window: This one is his home
Right window: That one is her home
then the whole line is colored pink, but on the left, is one is his
and on the right at one is her
parts are highlighted in red, as a mismatch:
This one is his home
That one is her home
How can I make vimdiff only highlight the actual differences?
This one is his home
That one is her home
Please visit https://github.com/rickhowe/diffchar.vim instead of https://github.com/vim-scripts/diffchar.vim. Thank you.
There is nothing built-in in vim to achieve this but you can use diffchar.vim
to achieve this.
After installing plugin, vimdiff
will give you character wise diff.
You can toggle between this mode and normal diff using F7 key
From plugin Readme:
For example, in diff mode: ([DiffText], )
(file A) The [quick brown fox jumps over the lazy] dog. (file B) The [lazy fox jumps over the quick brown] dog.
this plugin will exactly highlight the changed and added units:
(file A) The [quick] <brown >fox jumps over the [lazy] dog. (file B) The [lazy] fox jumps over the [quick] <brown >dog.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With