30

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.

mahemoff
  • 1,071
  • 2
  • 11
  • 16

3 Answers3

35

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.

Ingo Karkat
  • 23,523
24

If you're inside the NERDTree buffer you can select the folder and press C to change the NERDTree root directory. Just type :help NERDTreeMenu and go to line 252 typing 252G or 252gg to check it yourself.

5

Press "t" when the cursor is on the folder, it will switch to a new buffer with the nerdtree in the subfolder you have selected