1

I have the following structure of a tab in Vim. x marks the cursor position. (Note that I don't have control over how these windows are placed in the tab in the first place. It is the default debug output in Vimspector for those interested. There seems to be no easy way to customize the user interface of Vimspector.)

________________________________
a  |  d               |e        |
___|                  |         |
b  |                  |         |
___|    x             |         |  
c  |__________________|_________|
___|____________f_______________|                 

I would eventually like to obtain

________________________________
b  |  d                         |
___|    x                       |
c  |                            |
___|____________________________|
                                |
________________e_______________|

To do this, I started with :windo wincmd K<CR> based on suggestion here.

That gave rise to all windows being horizontally placed thus:

________________________________
______________f_____x___________|
______________e_________________|
______________d_________________|
______________c_________________|
______________b_________________|
______________a_________________|

Then, <C-W>c closed window f. But beyond this, I am stumped. I have looked at <C-W>Hand <C-W>K, but am unable to figure out the exact steps and sequence in which the output tab can be obtained in the format specified above. Any help is appreciated.

3
  • 1
    Can't you just close A and F and then from E do ctrl+w J?
    – B Layer
    Aug 26, 2021 at 13:42
  • @BLayer Indeed. I think that would work.
    – Tryer
    Aug 26, 2021 at 13:45
  • 1
    Groovy. :) Welcome to Vi & Vim SE.
    – B Layer
    Aug 26, 2021 at 13:57

1 Answer 1

1

There are multiple ways to do this, I'm sure, but it seems to me that a very straightforward approach is to...

  1. Close windows A and F (for example, just move the cursor to each one and do :close).

That'll leave you with:

_____________________________
 B  |  D         | E          |
    |            |            |
____|            |            |
 C  |            |            |
__ _|____________|____________|  
  1. Move to E and do Ctrl+W followed by Shift+J

That command moves the current window to the very bottom of the screen while taking up the entire width, i.e. your desired end state.

See :h CTRL-W_J

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.