1
autocmd! WinNew,WinEnter,WinLeave * if exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) == bufwinnr('%') | setlocal statusline=NERDTree | endif