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?
Splitting Vim Screen Vertically Press the keyboard combination Ctrl + w , followed by the letter 'v' .
To move between splits first press Ctrl-w (I remember this by Control Window, I'm not sure what the official mnemonic is) Then press a directional key to move the cursor to the split you're interested in. Directional key could be the arrows or my preferred home row method.
Split screen in half The most fundamental way to use split screen in Windows 10 is to drag an open window to the left or right side of the screen. This will automatically 'snap' that window to take up exactly half of the screen.
use :botright split
or :bo sp
, it does what you want
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With