Like what :Ve
and :E
did, but in NERDTree.
3 Answers
: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.
Do you want the ":NERDTree
" / ":NERDTreeToggle
" commands? Check out:
:help NERDTreeFunctionality
-
1
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()
-
I don't get it. Added to my .vimrc, nothing changed. I have to type
lcd %:p:h
, then opens :NERDTree?– ChengOct 18, 2010 at 3:36