autochdir
automatically sets the current working directory to the present file that the cursor is located on. I'd like to exclude autochdir
from changing the directory if the cursor is in the NERDTree window.
For example, if the present file I'm working on is in ~/foo
, and the NERDTree window is in ~/lots/of/stuff/here
, I'd like to go to the NERDTree window and still have the current working directory set to ~/foo
.
That way, one can apply the CD
keybind, which will set NERDTree's root tree node to ~/foo
. Otherwise, it's terribly inconvenient to manually change the root tree node in the NERDTree window by navigating to ~/foo
, and then applying the cd
keybind.
From
:help autochdir
:I.e. it is obsolete, inflexible and breaks plugins. I suggest you don't use it, and instead use one of the alternate, more configurable mechanisms here. For instance,
However, while this does not change the current directory when you pull up NERDTree, it will not preserve it, either. I'm not 100% sure what you mean in your last paragraph.