Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to locate active file in NERDTree quickly

Tags:

vim

nerdtree

say, I'm editing a file called application_controller.rb, which in ~/work/foo/app/controller/.

Now I want to open NERDTree window, and hope it can automatically expand the folder ~/work/foo/app/controller/, and position the cursor at the file application_controller.rb. How?

like image 326
Rocky Avatar asked Jan 18 '23 22:01

Rocky


1 Answers

:NERDTreeFind is most probably what you're looking for:

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.
like image 134
vstm Avatar answered Jan 21 '23 17:01

vstm