Plug 'preservim/nerdtree', { 'tag': '6.10.16' } let g:NERDTreeDirArrowExpandable = '▸' let g:NERDTreeDirArrowCollapsible = '▾' let NERDTreeDirArrows=1 map nt :NERDTreeToggle " Close nerdtree if it's the last buffer autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() \ | quit \ | endif " Mirror nerdtree in each tab autocmd BufWinEnter * silent NERDTreeMirror " check if reading from stdin autocmd StdinReadPre * let s:std_in=1 " open nerdtree if no args in passed to vim autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | wincmd p | endif " open nerdtree if vim opens to a directory autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') \ | execute 'NERDTree' argv()[0] \ | wincmd p \ | enew \ | execute 'cd '.argv()[0] \ | endif