I like how nerdtree looks as a side-drawer.

enter image description here but if I close current buffer using :bd

nerdtree will become a fullscreen buffer

enter image description here and all new buffers will simply take full screen, nerdtree won't toggle as drawer but as full screen all the time, untull its closed and reopened

enter image description here

is there any way to make nerdtree consistently open as a drawer and never go full screen?

  • 5
    This is clearly not the answer you're looking for but I've been struggling with NERDTree a long time before I realized that it is not worth the trouble. You might be interested in this article which explains pretty well why using NERDTree is not a good idea. NERDTree has several inconsistent behaviors which (IMO) make it unusable. If netrw is not good enough for you I would suggest that you have a look at dirvish which is a decent directory viewer.
    – statox
    Feb 15, 2017 at 13:07
  • @statox I fear your absolutely right. NERDTree just works on my nerves atm.
    – user10804
    Feb 15, 2017 at 15:24
  • Then it might be the moment to let it go ;) Honestly I was afraid to ditch nerdtree but then I realized that with all of the built-in facilities (netrw, :e, :find, :vimgrep, ...) and the available external tools (Once I got used to ctrlp my life changed) you really don't need a buggy/anti-vim-way plugin like NERDtree. But this conversation is becoming off topic for the question so I hope someone can help you. Also you should check nerdtree's issue tracker maybe you'll get an answer there.
    – statox
    Feb 15, 2017 at 15:55
  • 2
    Nerdtree is a good starter to get productive in vim as beginner. But it absolutly breaks all split related stuff. Once familiar with vim, you should get rid of it (in my opinion at least). I use github.com/tpope/vim-vinegar
    – B.G.
    Feb 16, 2017 at 6:51
  • 1
    @salivan nice =) i still suggest vinegar which is an ehanced version of netrw. But if you don't want that, i would map newtr to a single button (in vinegar its " - ") so you are fast in the filebrowser.
    – B.G.
    Feb 17, 2017 at 8:50

3 Answers 3


Some related posts are posted here and here. Basically if you use bd, vim will close the window the current buffer is in, causing Nerdtree window to take the whole screen. The simple mapping below prevent the window from closing after using bd:

nnoremap \d :bp<cr>:bd #<cr>

Feel free to change the mapped key as you wish.


With focus on NERDTree, type A. Then open some file from NERDTree and it will open correctly.

  • I don't have NERDTree installed, but from reading the documentation this looks like it could work (A "zooms" or "minimises/maximises" NERDTree). This answer could benefit from a bit more explanation of why it does, though.
    – Rich
    May 24, 2018 at 8:54

This happens sometimes.

Instead of using :NERDTreeToggle, use :NERDTree. This will use the default settings of the window size to open a new NERDTRee window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.