Reputation: 1933
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?
Upvotes: 28
Views: 4324
Reputation: 72606
In addition to Hasturkun's excellent answer, you may find some of the Ctrl-W
commands quite useful:
These are Ctrl-W
followed by (capital) H
, J
, K
or L
. These move the current window to the extreme left, bottom, top or right respectively. So to go from your 1 to 2, as an alternative to using :botright
, you could do a normal :sp
or :vsp
and then do Ctrl-W J
and the window will be moved to the bottom.
:help CTRL-W_H
:help CTRL-W_J
:help CTRL-W_K
:help CTRL-W_L
Upvotes: 20