When I switch minibufexplorer how to stop window resizing when opening nerdtree

my.vimrc:

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

at first it looks like this:

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

next, when I press F2, minibufexplorer was switched:

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

right now he saw how everything is in order, but when I press F2 again and minibufexplorer appears, the top window has been changed:

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

If the nerdtree window is missing on the right side of the window, it will not be changed. So how to stop window resizing when opening nerdtree? (By the way, sorry, I can’t upload a photo because I have only 8 reputations.)

+7
source share
1 answer

The problem is the line 450 minibufexpl.vim : in the StartExplorer function you will find set noequalalways . From :help equalalways :

When turned on, all windows automatically become the same size after splitting or closing the window. This also happens when the option is enabled. When turned off, splitting the window will reduce the size of the current window and leave the other windows the same. When the window is closed, additional lines are transferred to the window next to it (depending on 'splitbelow' and "splitright"). When mixing vertical and horizontally divided windows, the minimum size is calculated, and some windows may be larger if there is room. The "eadirection" option indicates in which direction the size affects. Changing the height and width of the window can be avoided by setting "winfixheight" and "winfixwidth" respectively. If the window size is specified when creating new window sizes, they are not aligned at present (this is difficult, but may be implemented in the future).

This is part of MiniBufExplorer , and if you want it to behave differently, you will have to either change it yourself or send a question to the author.

+5
source

All Articles