2

NerdTree docs says that to toggle maximize(zoom) and minimize the NERDTree, Shift-a is the key.

I have my .vimrc configured for regular split pane maximize/mini

let mapleader="<\Space>"
nnoremap <leader>- :wincmd _<cr>:wincmd \|<cr>
nnoremap <leader>= :wincmd =<cr>

So basically to zoom a regular window in vim, I press Space - and to zoom out Space + but this doesn't behave nicely when NERDTree is on. When NERDTree is on and I do Space - it zooms in, but when I press Space + it doesn't zoom out anymore, equally true both for the code window and the NERDTree window.

Xavier T.
  • 40,509
  • 10
  • 68
  • 97
Christian Sakai
  • 929
  • 3
  • 9
  • 25

2 Answers2

0

Very probably with

        exists("loaded_nerd_tree")
lab419
  • 1,129
  • 13
  • 16
0

Check if it's open anywhere

if bufwinnr("NERD_tree_2") == 1
  " something
else

Check if cursor is inside nerdtree

if bufname("") == "NERD_tree_2"
  " something
else
Pouya Sanooei
  • 1,012
  • 1
  • 13
  • 22