"More than two buffers in diff mode" - How to disable diff on buffers?

I did :vert diffsplit file1.txt , then I realized that I do not want to distinguish it except for another file. So I closed one window with :q and turned off diff highlighting with :diffoff .

Then I tried :vert diffsplit file2.txt , but now, if I try to dp or do put / receive changes, I get error E101: More than two buffers in diff mode, don't know which one to use .

How can I avoid this or what am I doing wrong?

+8
vim
source share
2 answers

You must disable the markup mode for the unwanted buffer with :diffoff before exiting with :q . Depending on your settings (for example :set hidden ), the buffer is saved in the buffer list ( :ls ), and Vim will take it into account when executing diff.

A :bufdo diffoff should disable diff for all existing buffers, although usually I just exit Vim and restart it with vimdiff ... if such a situation arises.

+11
source share

This may be partly a late answer, but still for future work

i do

 :tabdo diffoff! 
+1
source share

All Articles