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?

  • 2
    I don't know if it can restrict to words, but checkout the plugin mentioned in vi.stackexchange.com/questions/499/…
    – muru
    Commented Jun 15, 2015 at 10:46
  • Huh. Apparently it can. Add let g:DiffUnit="Word1" and it does word-level highlighting.
    – muru
    Commented Jun 15, 2015 at 17:53

1 Answer 1


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 and acknowledge you have read our privacy policy.

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