Opening a window in a horizontal section of a vertical split

I want both NERDTree and TagList to open at the same time, but I don't need them to have the entire height of the screen. Instead, I would like them to split horizontally within the same vertical split.

In particular, I want to be able to open one, say NERDTree, and occupy the entire height of the screen. Then, when I open the TagList, it will be horizontally split with the NERDTree window already open.

Is there any way to do this? Maybe not even "specific for these two plugins"?

+7
source share
3 answers

NERDTree and Taglist will not open inside sections.

Say you have a split buffer on the left (for example, source code) and a Taglist on the right.

You can put this in a function and call it with a mapping:

NERDTree " open NERDTree wincmd J " move NERDTree to the very bottom wincmd k " move the cursor to the above split (the source code buffer) wincmd H " move the split to the very left wincmd l " move the cursor back to the NERDTree split resize 20 " resize the split height to 20 exe 'vertical resize ' . g:NERDTreeWinSize " reset the split width 

This is pretty dodgy, but it works. You will see a brief visual glitch while the split jumps around the screen.

+7
source

Horizontal separation:

 :split 

Vertical separation:

 :vsplit 

Then, when you split your screen the way you like, open nerdtree inside the frame you want. (Or you can use the abbreviation: sp: vsp as suggested by @Vivek Pandey).

+1
source

I posted the solution in a duplicate post here: NERDTree and TList in

It includes editing the "taglist.vim" script to add a new split option when opened.

+1
source

All Articles