pocari
pocari

Reputation: 1161

How to split horizontally with the entire upper side in Vim?

+---------+---------+
|         |         |
|         |         |
| window1 | window2 |
|         |         |
|         |         |
+---------+---------+

in window2, :sp command split as following figure.

+---------+---------+
|         | window3 |
|         |         |
| window1 |---------|
|         | window2 |
|         |         |
+---------+---------+

but I want to split following figure, in window2.

+---------+---------+
|      window3      |
|                   |
+---------+---------+
| window1 | window2 |
|         |         |
+---------+---------+

Is there any way to this way?

Upvotes: 0

Views: 46

Answers (1)

romainl
romainl

Reputation: 196476

First, split window2 with :sp or <C-w>s.

Then move the new split above all windows with :wincmd K or <C-w>K.

So, either:

:sp|winc K

or:

<C-w>s<C-w>K

Upvotes: 1

Related Questions