Question

my .vimrc setting:

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

first it looks like:

--------------------------
| minibufexplorer   |    |
---------------------    |
|                   |    |
| top               |    |
|                   |    |
---------------------NERD|
|                   |    |
| btm               |    |
|                   |    | 
--------------------------

next when i press F2, minibufexplorer was toggled:

--------------------------
|                   |    |                  
|                   |    |
| top               |    |
|                   |    |
---------------------NERD|
|                   |    |
| btm               |    |
|                   |    | 
--------------------------

right now it seen like everything is ok, but when i press F2 again and minibufexplorer show up then the top window was resized:

--------------------------
| minibufexplorer   |    |
---------------------    |
| top               |    |
---------------------NERD|
|                   |    |
|                   |    |
|                   |    |
| btm               |    |
|                   |    | 
--------------------------

If there is no nerdtree window at the right, it will not resize. So how to stop resizing window when nerdtree is open? (btw: sorry, I can't upload pics cuz i only have 8 reputation.)

Was it helpful?

Solution

The problem is on line 450 of minibufexpl.vim: in the function StartExplorer, you will find set noequalalways. From :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).

This is part of MiniBufExplorer and if you want it to behave differently you will either have to change it yourself or submit an issue to the author.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top