【发布时间】:2014-10-14 11:36:09
【问题描述】:
我有一个类似于 md5sum 输出的文件,即它包含以下形式的行/行:
9803f392bb3f89f1c20bbc9baec8483a /some/path/file1
9803f392bb3f89f1c20bbc9baec8483a /some/other/path/file1
4ca001c5586eb0744e3174bc75c6fba8 /a/certain/path/file2
4ca001c5586eb0744e3174bc75c6fba8 /another/path/file2
4ca001c5586eb0744e3174bc75c6fba8 /some/different/path/file2withadifferentname
78753e869231cc1417a92eebaa076718 /and/so/on/file3
78753e869231cc1417a92eebaa076718 /and/so/forth/file
78753e869231cc1417a92eebaa076718 /something/like/that
假设文件按照 md5sums 排序(即前 32 个字符)。我想在 vim 中查看此文件,并使用其他颜色的线条,以便将相同的颜色分配给具有相同 md5sum 的文件。
这可以被认为是基于某些条件对行进行分组的特殊情况(在这种情况下,与前一行相比,前 32 个字符中的条件是相同的字符串)。
我怎样才能做到这一点?
【问题讨论】:
标签: vim colors highlighting