문제

I found this question, it's very good

Vim NERDTree: show only .txt files?

but, what also need:

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

show like

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

How can I acheive this purpose?

도움이 되었습니까?

해결책

Thanks for @Kev.

Use scrooloose nerdtree

Instead of Marty Grenfell nerdtree

The latter one doesn't support [[file]] magic flag

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

Both expresstions work.

You can type: :help pattern.txt and search /@! to see regex syntax detail.

Or there are 2 great links:

regular-expressions look around

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top