I have searched on net but everywhere use and example of VimDiff was there. Can someone please explain me how does vimdiff works ?
Basically the problem is we have two documents at system1 and syste2 has only document no1. now i need to compute some diff over two docs at system1 so that diff开发者_运维知识库 can be shipped over network and then we can generate doc2 using diff and doc1.
Depending on your goals, this is probably a solved problem. I would recommend using one of the following:
- If your documents are flat text files: diff and patch
- If your documents are binary data: rdiff
- If 2, but you'd like the diffing and patching to be handled for you: rsync
Regarding the question as asked, it looks like vimdiff uses an external program (typically diff, but can be specified). An explanation of how diff works is here: http://en.wikipedia.org/wiki/Diff#Algorithm
精彩评论