在垂直拆分的水平拆分中打开窗口 [英] Opening a window in a horizontal split of a vertical split

查看:32
本文介绍了在垂直拆分的水平拆分中打开窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望同时打开 NERDTree 和 TagList,但我不需要它们具有整个屏幕的高度.相反,我想让它们在单个垂直拆分中水平拆分.

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.

更具体地说,我希望能够打开一个,比如 NERDTree,并让它占据屏幕的整个高度.然后当我打开 TagList 时,让它与已经打开的 NERDTree 窗口水平分割.

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?

推荐答案

NERDTree 和 Taglist 不会在拆分中打开.

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

假设您在左侧有一个拆分缓冲区(例如源代码),在右侧有一个 Taglist.

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.

这篇关于在垂直拆分的水平拆分中打开窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆