2

This sounds like a trivial question, but I wasn't able to find an answer so far. I work with vimdiff as git mergetool. That means, when solving conflicts, I have four windows/buffers opened for editing:

+--------------------------------+
| LOCAL  |     BASE     | REMOTE |
+--------------------------------+
|             MERGED             |
+--------------------------------+

Is it possible to turn the diff mode ON just between BASE and REMOTE and to turn diff mode OFF for everything else?

Eugeniu Rosca
  • 5,177
  • 16
  • 45
  • Do you want it to be done automatically, each time you do `$ git mergetool`, or do you simply want to be able to do it on a case-by-case basis? – romainl Aug 19 '17 at 10:35
  • @romainl, Case by case would be enough! At first, I wonder if it is supported at all by vim/vimdiff. If yes, it's already great, then it's just a matter of some vim expert pointing you to the right line in the manual :) Thanks! – Eugeniu Rosca Aug 19 '17 at 10:48
  • 1
    Well, you can do `:diffoff` in `LOCAL` and `MERGED`. – romainl Aug 19 '17 at 10:51
  • @romainl, It works! I was blindly using the answer accepted in https://stackoverflow.com/a/4386234/2381750, which turns diff mode on/off globally for all windows. Now the `diffoff` windows don't scroll in sync with the `diffthis` windows, whcih seems to be fixed with `:set scrollbind`. Thanks a lot for your help! – Eugeniu Rosca Aug 19 '17 at 11:06
  • @romainl, Feel free to post an answer (which I will accept), mark the question as duplicate or take no action. – Eugeniu Rosca Aug 19 '17 at 11:37

0 Answers0