Like what :Ve and :E did, but in NERDTree.

link|improve this question

feedback

3 Answers

up vote 3 down vote accepted
:NERDTree %

Works for me. % is the path to the current file, so you can't cd to %, but NERDTree interprets it intelligently and opens the folder instead of the file.

link|improve this answer
feedback

Do you want the ":NERDTree" / ":NERDTreeToggle" commands? Check out:

:help NERDTreeFunctionality
link|improve this answer
1  
It seems :NERDTree opens the pwd where VIM started. – Cheng Oct 18 '10 at 3:21
feedback

One way is to automatically cd to the current file always. This works with NERDTree.

http://vim.wikia.com/wiki/Change_to_the_directory_of_the_current_file

function AlwaysCD()
  if bufname("") !~ "^ftp://"
    lcd %:p:h
  endif
endfunction
autocmd BufEnter * call AlwaysCD()
link|improve this answer
I don't get it. Added to my .vimrc, nothing changed. I have to type lcd %:p:h, then opens :NERDTree? – Cheng Oct 18 '10 at 3:36
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.