Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can you have vimdiff show the entire contents of the files being differenced? I'd like the color highlights of the differences, but would still like to see the entire files, i.e. the parts that are identical as well.

share|improve this question

3 Answers 3

up vote 20 down vote accepted

vimdiff sets foldmethod diff so all unchanged lines are folded. From inside vimdiff you can open all folds by pressing zR.

If you would like to always show the full context you could increase the number of unfolded context lines shown to some large number. In your ~/.vimrc:

if &diff                             " only for diff mode/vimdiff
  set diffopt=filler,context:1000000 " filler is default and inserts empty lines for sync
endif
share|improve this answer
4  
Yes, zR is the way to go. Note: za will recreate the folds. –  sleske Oct 12 '10 at 21:07

This answer to the question on stackoverflow is worth checking.

Vimdiff: What are the most frequently used commands/shortcuts that could get a newbie started?

in a nutshell: zo and zc to respectively open and close a section zM and zR to respectively expand and fold all the sections

share|improve this answer

Placing the cursor on the line you want to expand and hitting the space bar works for me!

It seems like I've had to use the arrow keys sometimes too.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.