Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add autocmds for fugitive integration

Add 2 autocmds - NERDTreeInit and NERDTreeNewRoot. These are called when
a tree is created and when the root is changed. The goal is to give the
fugitive plugin something to listen for so it can add the G* commands to
nerdtree buffers in git repo dirs.
  • Loading branch information...
commit 2cb0fc78fb4c7a1db5f51c042a447cc50f09983d 1 parent 678bb28
@scrooloose scrooloose authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 plugin/NERD_tree.vim
View
7 plugin/NERD_tree.vim
@@ -1211,6 +1211,8 @@ function! s:TreeFileNode.makeRoot()
if g:NERDTreeChDirMode ==# 2
exec "cd " . b:NERDTreeRoot.path.str({'format': 'Edit'})
endif
+
+ silent doautocmd User NERDTreeNewRoot
endfunction
"FUNCTION: TreeFileNode.New(path) {{{3
"Returns a new TreeNode object with the given path and parent
@@ -3052,11 +3054,12 @@ function! s:initNerdTree(name)
let b:NERDTreeShowHidden = g:NERDTreeShowHidden
let b:NERDTreeShowBookmarks = g:NERDTreeShowBookmarks
let b:NERDTreeRoot = newRoot
-
let b:NERDTreeType = "primary"
call s:renderView()
call b:NERDTreeRoot.putCursorHere(0, 0)
+
+ silent doautocmd User NERDTreeInit
endfunction
"FUNCTION: s:initNerdTreeInPlace(dir) {{{2
@@ -3086,6 +3089,8 @@ function! s:initNerdTreeInPlace(dir)
let b:NERDTreeType = "secondary"
call s:renderView()
+
+ silent doautocmd User NERDTreeInit
endfunction
" FUNCTION: s:initNerdTreeMirror() {{{2
function! s:initNerdTreeMirror()
Please sign in to comment.
Something went wrong with that request. Please try again.