How can I visualize per-character differences in a unified diff file?

后端 未结 7 1934
庸人自扰
庸人自扰 2020-11-30 17:13

Say I get a patch created with git format-patch. The file is basically a unified diff with some metadata. If I open the file in Vim, I can see which lines have

7条回答
  •  我在风中等你
    2020-11-30 17:50

    After a little research, I notice this question has come up twice recently on the main Vim mailing list. The NrrwRgn plugin was mentioned both times (make two narrow regions and diff them). Using NrrwRgn as described by Christian Brabandt feels more like a workaround than a solution, but maybe that's good enough.

    I tried out NrrwRgn and it, together with :diffthis, was indeed useful for illustrating per-character differences within parts of a single file. But it took many keystrokes. My Vimscript is pretty rusty, but it could likely be scripted. Maybe NrrwRgn could be enhanced to provide the desired functionality.

    Thoughts?

提交回复
热议问题