From 579d96a0f3b8414916a158c24d8ee9131c5f6845 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Thu, 10 Jul 2014 20:14:41 +0100 Subject: [PATCH] remove testing git plugin --- nerdtree_plugin/git.vim | 65 ----------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 nerdtree_plugin/git.vim diff --git a/nerdtree_plugin/git.vim b/nerdtree_plugin/git.vim deleted file mode 100644 index 67dff59..0000000 --- a/nerdtree_plugin/git.vim +++ /dev/null @@ -1,65 +0,0 @@ -" ============================================================================ -" File: git.vim -" Description: Expt. plugin to add git flags to the UI -" Maintainer: -" License: This program is free software. It comes without any warranty, -" to the extent permitted by applicable law. You can redistribute -" it and/or modify it under the terms of the Do What The Fuck You -" Want To Public License, Version 2, as published by Sam Hocevar. -" See http://sam.zoy.org/wtfpl/COPYING for more details. -" -" ============================================================================ -if exists("g:loaded_nerdtree_git") - finish -endif -let g:loaded_nerdtree_git = 1 - -call g:NERDTreeRefreshNotifier.AddListener("g:NERDTreeGitRefreshListener") - -function! g:NERDTreeGitRefreshListener(path) - if !isdirectory(b:NERDTreeRoot.path.str() . '/.git') - return - end - - let modifiedFiles = s:GetModifiedFiles() - if index(modifiedFiles, a:path.str()) >= 0 - call a:path.flagSet.addFlag("git", "+") - else - call a:path.flagSet.removeFlag("git", "+") - endif -endfunction - -"Cache the list of modified files for a few seconds - otherwise we must shell -"out to get it for every path that is refreshed which takes ages -function! s:GetModifiedFiles() - if !exists('s:modifiedFiles') || (localtime() - s:modifiedFilesTime > 2) - let s:modifiedFiles = split(system('git -C ' . b:NERDTreeRoot.path.str() . ' ls-files -m')) - let s:modifiedFilesTime = localtime() - call map(s:modifiedFiles, 'b:NERDTreeRoot.path.str() . "/" . v:val') - endif - - return s:modifiedFiles -endfunction - -autocmd filetype nerdtree call s:AddHighlighting() -function! s:AddHighlighting() - syn match NERDTreeGitflag #^ *\zs\[+\]# containedin=NERDTreeFile - hi link NERDTreeGitFlag error -endfunction - -"when a buffer is saved, refresh it in nerdtree -autocmd bufwritepost * call s:FileUpdated(expand("%")) -function! s:FileUpdated(fname) - if !nerdtree#isTreeOpen() - return - endif - - call nerdtree#putCursorInTreeWin() - let node = b:NERDTreeRoot.findNode(g:NERDTreePath.New(a:fname)) - if !empty(node) - call node.refresh() - endif - - call NERDTreeRender() -endfunction -