Let NERDTree works like VimFiler. That means:
lkey open directory node, andhkey close directory node(even while the cursor is on the child node).
To install this plugin just put the plugin files in your ~/.vim (Linux/macOS)
or ~/vimfiles (Windows).
Plugin 'flw-cn/vim-nerdtree-l-open-h-close'Plug 'flw-cn/vim-nerdtree-l-open-h-close'By default, l is the shortcut key to open directory node and h to
close directory node.
If you want to change the key, please add following lines into your vimrc:
let g:NERDTreeMapOpenDirNode = 'L'
let g:NERDTreeMapCloseDirNode = 'H'