4

It's clear how I would go about changing the orientation from a vertical split to horizontal with 2 panes, but I'm curious if it's possible to do it when I have 3 or more panes. Consider the following window setup:

+-----------------+
|Nerd |   |   |   |
|Tree | 1 | 2 | 3 |
|     |   |   |   |
+-----------------+

So, in this setup, you can see I'm focused on 3 vertically split panes. However, I would like to "rotate" 2 and 3 to use a horizontal split instead, thus resulting in something like the following:

+-----------------+
|Nerd |     |  2  |
|Tree |  1  |-----|
|     |     |  3  |
+-----------------+

Is something like this possible?

naivedeveloper
  • 2,814
  • 8
  • 34
  • 43
  • Similar post: [How do I toggle between a Vertical and a Horizontal split in vimdiff?](http://stackoverflow.com/q/5682759/438329). However I am going to say I have rarely had the need for 4 splits open at any one time for any length of time. I find that I am a very simple person and can only do about 2 splits at a time (3 occasionally!). This might be a good time to wean yourself off of having NerdTree open so much – Peter Rincker Jan 27 '15 at 17:56
  • Hi, thanks Peter. I understand the comment about having NerdTree open, but I feel this scenario is pretty common--in my case, I am working on a reusable widget that contains a JS, CSS, and template file. I suppose I could switch buffers and whatnot to avoid the visual burden. – naivedeveloper Jan 27 '15 at 18:54

2 Answers2

3
  1. focus 2 then :hide
  2. focus 3 then :sp 2 (2 here should be filename, or :sb (2's buf number) )

demo:

enter image description here

Kent
  • 189,393
  • 32
  • 233
  • 301
0

In each window, CTRL-W J will move it to a horizontally split window at the bottom. Then CTRL-W H on the NERD Tree window to move it vertical left.

I have not found a better way, unfortunately. This method scales very poorly.

Ben
  • 8,725
  • 1
  • 30
  • 48