8

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

More specifically, I want to be able to open one, say NERDTree, and have it take up the full height of the screen. Then when I open TagList, to have it horizontally split with the already open NERDTree window.

Is there a way to do this? Possibly even a non 'specific to these two plugins' way?

0

3 Answers 3

8

NERDTree and Taglist aren't going to open inside splits.

Let's say you have a split buffer on the left (for eg. source code), and Taglist on the right.

You can put this in a function, and invoke 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'll see a brief visual glitch while the split jumps around the screen.

1

Horizontal split:

:split 

Vertical split:

:vsplit

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

4
  • 2
    :sp and :vsp would save a few key strokes (they uniquely expand to :split and :vsplit) May 15, 2011 at 6:13
  • How do you open either of these plugins in a specific window? May 15, 2011 at 13:13
  • First you split the window. then go into desired window and open the desired plugin
    – Heisenbug
    May 15, 2011 at 13:15
  • 1
    Is there some way of doing this I don't know about? The only way I know of opening the plugins opens them in a new split, not in the current window May 15, 2011 at 19:01
1

I've posted a solution in a duplicate post here: NERDTree & TList in

It involves editing the 'taglist.vim' script a bit to add a new split option when opening.

Your Answer

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

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