Change current directory using NERDTree

23

8

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

Posted 2014-07-12T17:00:05.693

Reputation: 803

Answers

27

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

Posted 2014-07-12T17:00:05.693

Reputation: 19 513

11

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.

Rafael Berro

Posted 2014-07-12T17:00:05.693

Reputation: 211

This is a capital 'C'. – emhohensee – 2019-11-22T19:21:00.157