commit 186abb84c18ef0f3ebcc2c9baf83101563d126cc
parent 10ba84b1fc15938a3e855d12318fe9c82cd6147f
Author: Martin Grenfell <martin.grenfell@gmail.com>
Date: Thu, 26 Jun 2014 09:48:39 +0100
Merge pull request #303 from amarshall/wildignore
Add option to respect wildignore
Diffstat:
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt
@@ -635,6 +635,8 @@ NERD tree. These options should be set in your vimrc.
|'NERDTreeIgnore'| Tells the NERD tree which files to ignore.
+|'NERDTreeWildIgnore'| Tells the NERD tree to respect |'wildignore'|.
+
|'NERDTreeBookmarksFile'| Where the bookmarks are stored.
|'NERDTreeBookmarksSort'| Whether the bookmarks list is sorted on
@@ -825,6 +827,13 @@ The file filters can be turned on and off dynamically with the |NERDTree-f|
mapping.
------------------------------------------------------------------------------
+ *'NERDTreeWildIgnore'*
+Values: 0 or 1.
+Default: 0.
+
+If set to 1, the |'wildignore'| setting is respected.
+
+------------------------------------------------------------------------------
*'NERDTreeBookmarksFile'*
Values: a path
Default: $HOME/.NERDTreeBookmarks
diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim
@@ -228,7 +228,7 @@ function! s:TreeDirNode._initChildren(silent)
let dir = self.path
let globDir = dir.str({'format': 'Glob'})
- if version >= 703
+ if version >= 703 && g:NERDTreeWildIgnore
let filesStr = globpath(globDir, '*', 1) . "\n" . globpath(globDir, '.*', 1)
else
let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*')