10

As far as I understand the default vimdiff is doing only linewise diffs. However somtimes 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?

  • 2
    I don't know if it can restrict to words, but checkout the plugin mentioned in vi.stackexchange.com/questions/499/… – 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
6

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.