Opening a window in a horizontal split of a vertical split

前端 未结 3 1819
予麋鹿
予麋鹿 2021-01-12 03:00

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 horiz

3条回答
  •  死守一世寂寞
    2021-01-12 03:24

    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.

提交回复
热议问题