You could try something like:
nnoremap <leader>n :NERDTree /path/to/folder<CR>
I have this in my .vimrc:
set autochdir
let NERDTreeChDirMode=2
nnoremap <leader>n :NERDTree .<CR>
so that NERDTree always opens in the current folder.
With the 1st line, the working directory is always the one where the active buffer is located.
With the 2nd line, I make sure the working directory is set correctly.
With the 3rd line, I hit <leader>n
to open NERDTree.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…