Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent fuzzyfinder loading files in NERDTree window

I'm using both fuzzyfinder and NERDTree for vim. When my cursor is in the Window that NERDTree resides in and I use fuzzyfinder, it will open a file in the NERDTree window.

Is there a way to prevent this behaviour and force files not to open in the NERDTree window?

like image 703
Julian Krispel-Samsel Avatar asked Dec 10 '12 11:12

Julian Krispel-Samsel


1 Answers

You'd have to use a custom mapping or override the default FuzzyFinder mapping to start it. In there you can then check for an open NERDTree, and jump to the previous window (or maybe close NERDTree), like this:

:nnoremap <silent> <F5> :<C-u>if exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) == winnr() <Bar> wincmd p <Bar> endif <Bar> FufBuffer<CR>
like image 182
Ingo Karkat Avatar answered Oct 17 '22 10:10

Ingo Karkat