When use vim with nerdtree, I opened a file in a project. Press <Leader> key to trigger NERDTreeToggle. On the left side it will list the whole project directory by default.

enter image description here

I want to let it focus on the opened file's absolute path automatically without unfold the root directory again. Can it do?

enter image description here

1 Answer 1


Use the NERDTreeFind command instead of NERDTreeToggle.

  • 1
    Thank you for the right solution!
    – Miantian
    Dec 1, 2021 at 7:54

Your Answer

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

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