NerdTree - Reveal file in tree

Akshay Rawat picture Akshay Rawat · Oct 7, 2011 · Viewed 26.4k times · Source

Is there a shortcut which reveal the current file in the NerdTree directory panel.

Like TextMate 'Reveal file in Drawer' - Ctrl+Command+R

Answer

Thomas picture Thomas · Oct 7, 2011

in :h NERDTree:

:NERDTreeFind                                                  :NERDTreeFind
    Find the current file in the tree. If no tree exists for the current tab,
    or the file is not under the current root, then initialize a new tree where
    the root is the directory of the current file.

I don't think it's bound to anything by default, so you have to do a keybind yourself.

nmap ,n :NERDTreeFind<CR>

is what appears in my .vimrc, along with

nmap ,m :NERDTreeToggle<CR>