From 89e771ea963baafd2918019bc8083cfd32f43aa6 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Fri, 30 Mar 2012 16:09:25 +0100 Subject: [PATCH] make fugitive commands available in nerdtree bufs Previously s:Detect() wasnt getting called for nerdtree buffers. I have added two autocmd events to nerdtree - NERDTreeInit and NERDTreeNewRoot. These are called when a tree is created, and when the user changes the root. Catch these events and call s:Detect() with the tree root path. --- plugin/fugitive.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index c76ffa4..9a6a9d3 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -162,6 +162,7 @@ augroup fugitive autocmd! autocmd BufNewFile,BufReadPost * call s:Detect(expand(':p')) autocmd FileType netrw call s:Detect(expand(':p')) + autocmd User NERDTreeInit,NERDTreeNewRoot call s:Detect(b:NERDTreeRoot.path.str()) autocmd VimEnter * if expand('')==''|call s:Detect(getcwd())|endif autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('')), 'fugitive_leave') augroup END