On 01/15/12 08:03, Bram Moolenaar wrote:

Claus Atzenbeck wrote:

Am 13.01.2012 um 15:46 schrieb Taylor Hedberg:

I'm not sure you can. According to `:help diff-diffexpr`, Vim requires
the output of the diff program to be an "ed-style" diff, which is
fundamentally linewise. Maybe you could come up with a wrapper script
that would mangle wdiff's output into ed format, but even if possible,
that seems like it would be error-prone and probably more trouble than
it's worth.

I see your point.

Interestingly, it seems that word wise diffs are not that much
needed/wanted for Vim.

It's not that they are not wanted, it's that there is no standard syntax
for an external diff program output unless it's by lines.

Fortunately at least with wdiff, there's an option to change the pre/post markers for the text added/deleted via the --{start,end}-{delete,insert} command-line flags, so the diff could accommodate a fairly arbitrary syntax. When I've wanted to see a word-diff, I usually use the default wdiff tags and then do something like

wdiff 1.txt 2.txt | vi -c 'match DiffDelete /\[-.\{-}-]/' -c '2match DiffAdd /{+.\{-}+}/' -

which visually highlights the changes. This could be wrapped up in a pretty simple shell/batch script.

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to