Vim – How to Change Current Directory Using NERDTree

nerdtreevim

How can I navigate to a file or folder in NERDTree and change the working directory to that folder (or the folder containining the file I'm on).

I know it's possible to keep NERDTree in sync with the NERDTree root (nerdtree and current directory), but I'm looking for a macro or something that would change the folder without having any impact on NERDTree itself.

Best Answer

You're looking for the cd mapping. Type this inside the NERDTree sidebar, and the current directory will be changed to the current entry's. See :help NERDTree-cd.

Related Question