Change current directory using NERDTree
Solution 1
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
.
Solution 2
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.
Solution 3
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
Related videos on Youtube
mahemoff
My last permanent role was on Google's Chrome team, helping external developers learn and use HTML5 and Chrome tools. I'm currently baking node apps. I'm an Aussie in London. Home http://mahemoff.com Blog http://softwareas.com Plus http://mahemoff.com/+@mahemofflinkedin
Updated on September 18, 2022Comments
-
mahemoff over 1 year
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.
-
emhohensee over 4 yearsThis is a capital 'C'.
-
Admin almost 2 years
Sorry, no help for NERDTree-cd
-
Admin almost 2 years@Jonathon Here it is: github.com/scrooloose/nerdtree/blob/… You may have to run
:helptags
.