NERDTree只显示.cpp和.h,同时不会忽略目录

时间:2013-11-19 03:35:20

标签: nerdtree

我发现了这个问题,非常好

Vim NERDTree: show only .txt files?

但是,还需要:

dir1/
 -1.cpp
 -1.h
 -1.o
dir2/
dir3/
 -3.txt

显示

dir1/
 -1.cpp
 -1.h
dir2/
dir3/

我怎样才能达到这个目的?

1 个答案:

答案 0 :(得分:0)

感谢@Kev。

使用scrooloose nerdtree

而不是Marty Grenfell nerdtree

后者不支持[[file]]魔法旗帜

"let NERDTreeIgnore = ['^\(.*\.\(cpp\|h\)$\)\@!.*[[file]]']
let NERDTreeIgnore = ['\(\.cpp\|\.h\)\@<!$[[file]]']

两种表达都有效。

您可以输入::help pattern.txt并搜索/@!以查看正则表达式语法详细信息。

或者有两个很棒的链接:

regular-expressions look around

Regular expression to match a line that doesn't contain a word?

相关问题