简体   繁体   中英

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

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: 在此处输入图像描述

After using the Menu: 在此处输入图像描述

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$']

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

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

set cmdheight=2

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM