Search code examples
vimvim-pluginnerdtree

Is it possible to configure behaviour of NERDTreeToggle to use NERDTreeFind when opening?


Is it possible to configure NERDTree so that :NERDTreeToggle acts like :NERDTreeFind if a buffer is not open (instead of the default :NERDTree) ?

Failing that, would it be possible to create a mapping/small script that could check the visibility of the NERDTree window and if open close it, if closed invoke NERDTreeFind ? I looked at the NERDTree documentation to find if the visibility of the NERDTree window was open, but could not find it.


Solution

  • You can set let NERDTreeQuitOnOpen=1 to close the tree when you select a file, and create a mapping for find:

    nmap <leader>p :NERDTreeFind<CR>