Take diff of two vertical opened windows in Vim

后端 未结 4 868
醉话见心
醉话见心 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:20

    To begin diffing on all visible windows:

    :windo diffthis
    

    which executes :diffthis on each window.

    To end diff mode:

    :diffoff!
    

    (The ! makes diffoff apply to all windows of the current tab - it'd be nice if diffthis had the same feature, but it doesn't.)

提交回复
热议问题