gpt4 book ai didi

vim - 在垂直拆分的水平拆分中打开窗口

转载 作者:行者123 更新时间:2023-12-04 11:14:49 26 4
gpt4 key购买 nike

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

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

有没有办法做到这一点?甚至可能是非“特定于这两个插件”的方式?

最佳答案

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

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

你可以把它放在一个函数中,并用一个映射来调用它:

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

这很狡猾,但它有效。当分割在屏幕上跳跃时,您会看到一个短暂的视觉故障。

关于vim - 在垂直拆分的水平拆分中打开窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6005874/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com