vimdiff 仅显示父行的差异

vimdiff 仅显示父行的差异

两个配置文件包含许多以下形式的块

block name {
  .....
  sub block name1 {
      .........
      sub block name2 {
          ....
      }
  }
  .....
}

例子:

输入(左):

ltm pool PROD_VAS_START_STOP1_1234 {
   allow-nat yes
   allow-snat yes
   app-service none
   autoscale-group-id none
   description PROD_VAS_START_STOP1_1234
   gateway-failsafe-device none
   ignore-persisted-weight disabled
   ip-tos-to-client pass-through
   ip-tos-to-server pass-through
   link-qos-to-client pass-through
   link-qos-to-server pass-through
   load-balancing-mode round-robin
   members {
       PROD_10.10.10.10:8560 {
           address 10.20.30.40%4
           app-service none
           connection-limit 0
           description none
           dynamic-ratio 1
           ephemeral false
           inherit-profile enabled
           logging disabled
           monitor default
           priority-group 0
           rate-limit disabled
           ratio 1
           session user-disabled
           state user-down
           fqdn {
               autopopulate disabled
               name none  // For ex this line is different b/w two files
           }
           metadata none
           profiles none
       }
       PROD_10.10.10.30:1260 {
           address 10.10.22.30%4

预期输出如下:

Output  (LHS):

ltm pool PROD_VAS_START_STOP1_1234 {
        members {
               PROD_10.10.10.10:8560 {
                          fqdn {
                                  name none  // For ex this line is different b/w two files

现在vimdiff,我可以看到以 html 形式存储的差异,如下所示。但如果块内至少有一个差异,我希望查看完整的来源块行。

我使用的命令如下。

vimdiff out1.txt out2.txt -C 6 -c TOhtml -c 'w! diff1.html' -c 'qa!'

差异 缺失 所属 ltm 条目

相关内容