Вопрос

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