I'm not quite sure of the difference between cd and CD in NERDTree. It seems to actually cd into a directory I have to do cdCD, so for me they are kind of mushed together. From the docs it says:

CD -- Change the NERDTree root to Vim's current working directory.

cd -- Change the NERDTree root to Vim's current working directory.

What exactly is the difference, and what might be an example of only using cd or only using CD ? It seems like an odd conception.

1 Answer 1


Actually, what NERDTree's help says is:

cd: Change the CWD to the dir of the selected node. |NERDTree-cd|

CD: Change tree root to the CWD. |NERDTree-CD|

See also the linked :help NERDTree-cd and :help NERDTree-CD.

In other words, cd will change the Vim notion of the current directory, same as the built-in :cd command does.

And CD will take the current directory from Vim (the one you can change with the :cd command) and make that the new root of the NERDTree pane.

So, indeed, using cdCD will work to change the NERDTree root, first by hanging Vim's current directory, then asking NERDTree to reflect that newly updated current directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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