如何快速找到NERDTree中的活动文件

Roc*_*cky 4 vim nerdtree

比如,我正在编辑一个名为application_controller.rb的文件,该文件位于~/work/foo/app/controller/.

现在我想打开NERDTree窗口,希望它能自动扩展文件夹~/work/foo/app/controller/,并将光标定位在文件中application_controller.rb.怎么样?

vst*_*stm 8

:NERDTreeFind 很可能是你在寻找的东西:

Find the current file in the tree.

If not tree exists and the current file is under vim's CWD, then init a
tree at the CWD and reveal the file. Otherwise init a tree in the current
file's directory.
Run Code Online (Sandbox Code Playgroud)