Search code examples
vimsplitvimdiff

How can I split horizontally across several vertically split windows in Vim?


Basically, I want to go from 1) to 2) I usually do this by splitting horizontally first and then vertically, but as I want this to do three-way diffs, it is much handier to start vim by running:

$ vimdiff file1 file2 file3

And then doing something to open the split window below.

1)
    +----+----+----+
    ¦    ¦    ¦    ¦
    ¦ f1 ¦ f2 ¦ f3 ¦
    ¦    ¦    ¦    ¦
    +----+----+----+

2)
    +----+----+----+
    ¦    ¦    ¦    ¦
    ¦ f1 ¦ f2 ¦ f3 ¦
    +----+----+----+
    ¦      f4      ¦
    +--------------+

Does anyone know of a way to this?


Solution

  • use :botright split or :bo sp, it does what you want