gpt4 book ai didi

vim - 当我切换 minibufexplorer 时,如何在 nerdtree 打开时停止调整窗口大小

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

我的 .vimrc 设置:

nmap <silent><F1> :NERDTreeToggle<CR>
nmap <silent><F2> :TMiniBufExplorer<CR>
let g:miniBufExplMapWindowNavVim = 1
let g:NERDTreeWinPos = "right"

首先它看起来像:
--------------------------
| minibufexplorer | |
--------------------- |
| | |
| top | |
| | |
---------------------NERD|
| | |
| btm | |
| | |
--------------------------

接下来当我按 F2 时,minibufexplorer 被切换:
--------------------------
| | |
| | |
| top | |
| | |
---------------------NERD|
| | |
| btm | |
| | |
--------------------------

现在看起来一切正常,
但是当我再次按 F2 并且 minibufexplorer 出现时
然后调整顶部窗口的大小:
--------------------------
| minibufexplorer | |
--------------------- |
| top | |
---------------------NERD|
| | |
| | |
| | |
| btm | |
| | |
--------------------------

如果右侧没有 nerdtree 窗口,则不会调整大小。
那么如何在 nerdtree 打开时停止调整窗口大小?
(顺便说一句:抱歉,我无法上传图片,因为我只有 8 个声望。)

最佳答案

问题出在 minibufexpl.vim 的第 450 行: 在函数中 StartExplorer , 你会发现 set noequalalways .来自 :help equalalways :

When on, all the windows are automatically made the same size after splitting or closing a window. This also happens the moment the option is switched on. When off, splitting a window will reduce the size of the current window and leave the other windows the same. When closing a window the extra lines are given to the window next to it (depending on 'splitbelow' and 'splitright'). When mixing vertically and horizontally split windows, a minimal size is computed and some windows may be larger if there is room. The 'eadirection' option tells in which direction the size is affected. Changing the height and width of a window can be avoided by setting 'winfixheight' and 'winfixwidth', respectively. If a window size is specified when creating a new window sizes are currently not equalized (it's complicated, but may be implemented in the future).



这是 MiniBufExplorer 的一部分如果您希望它的行为有所不同,您将不得不 change it yourselfsubmit an issue给作者。

关于vim - 当我切换 minibufexplorer 时,如何在 nerdtree 打开时停止调整窗口大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11409671/

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