Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening a file in Vim opens vim diff?

When I open a file in vim, lets call it 'file1.rb', this file opens normally with ruby syntax highlighting and no problems up to this point.

When I open 'file2.rb' in a new buffer, it turns both of the buffers into vim diff.

I can switch buffers back and forth but what I'll see is a vim diff of the file open in each buffer. When I delete one of the buffers, I can use vim normally again without the vim diff color highlighting in the way.

At the moment I have only one buffer open at a time so that I don't run into this problem but I would like to have both of these buffers open at the same time with out it showing vim diff of the files.

Where can I disable this odd behavior, or any way I can stop this from happening?

like image 307
csebryam Avatar asked Jun 30 '26 12:06

csebryam


1 Answers

Diff mode is enabled either by one of the :diffthis or :diffsplit commands, or directly by :setlocal diff.

For the latter case, a :verbose setlocal diff? might tell you where it got set (when executed in one of the affected windows).

For the former, you can capture a full log of a Vim session with vim -V20vimlog. After quitting Vim, examine the vimlog log file for suspect commands; i.e. search for 'diff'.

like image 185
Ingo Karkat Avatar answered Jul 03 '26 01:07

Ingo Karkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!