On Tuesday, June 5, 2012 10:10:16 AM UTC-5, Ben Fritz wrote:
> 
> I cannot understand what you're trying to show with your examples, but I
> THINK from your description that you're looking for a way to manually align
> lines in diff mode. As you mention BeyondCompare can do this, as well as
> KDiff3 and probably some other dedicated visual diff tools.
> 
> [Snip]
> 
> Actually, thinking about it some more...I bet someone could use diffexpr to
> pass PORTIONS of the file to diff rather than entire files, and then
> concatenate the resulting diffs together. The portions start/end positions
> would be defined by mappings invoked by the user, probably to place some
> signs in each buffer. This actually sounds like a fun project to try
> sometime...

Attached is a proof-of-concept. I plan to polish this up some later and post
to vim.org as a plugin.

Hit \p1 on the second file and \p2 on the first file where you want an
alignment (remember this is proof of concept: it only supports one alignment,
and you need to know which file Vim considers the "in" file and which it
considers the "new" file).

Interestingly, I found that Vim first invokes the diffexpr with two files with
content "line1" and "line2" to test that diff actually will work before
invoking with the full file. This caused me quite a bit of grief before I
figured out what was going on.

-- 
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

Attachment: manDiffAlign.vim
Description: Binary data

Reply via email to