how to restore the original size after using the NERDTree Menu in Vim?
Asked Answered
E

4

13

I use NERDTree as a file explorer and after using its Menu, Vim does not return to its original size, see screenshots below.

Using NERDTree Menu: enter image description here

After using the Menu: enter image description here

The editor returns to normal only if I resize the terminal window.

My system config

  • Vim-GTK3 9.0
  • Terminal: Konsole
  • Debian 11

NERDTree Config

  • nmap <Leader>nt :NERDTreeFind<CR>
  • let NERDTreeQuitOnOpen=1
  • let NERDTreeShowHidden=1
  • let g:NERDTreeDirArrowExpandable = '▸'
  • let g:NERDTreeDirArrowCollapsible = '▾'
  • let g:NERDTreeIgnore = ['^node_modules$']
Erminois answered 11/9, 2022 at 18:40 Comment(4)
For the past couple of weeks, I'm experiencing the same problem. Are you using a Night Owl theme?Highsounding
vimcasts.org/blog/2013/01/…Zaidazailer
@Highsounding , I am using CatppuccinErminois
:resize in my main window is a manual workaround.Newsmagazine
T
11

I have a same issue and I have remove vim v9 and install from source last v8 and it's work! I don't know what is happen in 9 version vim with the bottom pane, but I have observe that vim v8 on my remote server have a perfect working.

UPD: And I founded issue on the NERDTree repo with the issue: https://github.com/preservim/nerdtree/issues/1321

Talishatalisman answered 4/10, 2022 at 8:4 Comment(7)
how did you install a v8 of vim?Politick
@Politick are you using linux?Erminois
i'm using MacOs @AntonyChavezPolitick
It is a solution, but only a work-around. It would be preferred if the menu was the same but after closing it, cmd height resets.Jacquelinejacquelyn
i did not downgrade to v8 since homebrew only installs latest/stable release, instead i added this to my .vimrc config: let g:NERDTreeMinimalMenu=1Politick
if you guys are using neovim i suggest downgrade to 0.7.2, higher version has the same issuePolitick
I have installed v8 from sources - github.com/vim/vim/releases/tag/v8.2.5172 But it was before that I founded nerdtree issue :) I think @Politick are right - for the solution you need install latest NERDTree version. NERDTree developers fixed the issue :)Talishatalisman
M
3

You can set cmdheight to 2 to solve the problem. Add the following line into your .vimrc

set cmdheight=2

Methedrine answered 23/10, 2022 at 7:43 Comment(0)
E
1

This is caused by an incompatibility between NERDTree and Vim 9.0.

You can fix it by applying this hotfix to your local copy of NERDTree.

Some alternatives:

  • Add let g:NERDTreeMinimalMenu=1 to your .vimrc to set menu to display in a single line
  • Use a version of Vim earlier than the 9.0 release

See issue #1321 in the NERDTree repo for more info.

Emilio answered 4/1, 2023 at 14:23 Comment(0)
E
0

This problem remains relevant. To restore the window size, you can try these shortcuts:

  • Ctrl+w _
  • Ctrl+w |
  • Ctrl+w =

Source: https://vim.fandom.com/wiki/Resize_splits_more_quickly

Emergent answered 9/10, 2022 at 8:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.