14

As far as I understand the default vimdiff is doing only line-wise diffs. However sometimes is useful to do word level diff, especially for text files like Markdown, LaTeX etc. There are some tools like wdiff or dwdiff which do the diff in word level.

Is it possible to use them in Vim to compare side-by-side two text files?

Vivian De Smedt
  • 16,336
  • 3
  • 18
  • 37
corion
  • 311
  • 2
  • 7
  • 2
    I don't know if it can restrict to words, but checkout the plugin mentioned in http://vi.stackexchange.com/questions/499/more-detailed-comparison-within-a-line – muru Jun 15 '15 at 10:46
  • Huh. Apparently it can. Add let g:DiffUnit="Word1" and it does word-level highlighting. – muru Jun 15 '15 at 17:53

1 Answers1

7

One solution, as suggested by muru (thanks), is to use the diffchar.vim plugin and setting the let g:DiffUnit="Word1". This plugin should be used in the standard vimdiff session.

corion
  • 311
  • 2
  • 7