Take diff of two vertical opened windows in Vim

后端 未结 4 870
醉话见心
醉话见心 2020-12-22 18:54

I\'ve have two files opened. They are opened in vertical mode, next to next. Can I instantly diff these two files without leaving or closing Vim ?

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-22 19:22

    Following on the earlier answers I adapted the mapping provided by @cxw. The following mapping automatically closes NERDTree and diffs the open windows. It does not matter if NERDTree is closed, it works the same way. I do this quite often so it saved me quite some time.

    command! Difft NERDTreeClose | windo diffthis
    

提交回复
热议问题