Vim NERDTree: show only .txt files?

Using the NERDTree plugin , I want to view only * .txt files. There is a NERDTreeIgnore variable, but I need something like NERDTreeWhitelistFilter .

Is there a way to whitelist what I see?

+7
source share
2 answers

Is this what you want:

 :let NERDTreeIgnore += ['\(\.txt\)\@<!$[[file]]'] 
+4
source

I played with this - this is an interesting problem. Maybe you can try this regex to ignore files?

Edit: talked to my colleague. Here's the correct regular expression (my original matches the "txt" at the beginning of the file name too).

 ^(?!.*\.txt$).* 
+5
source

All Articles