2

I want to open all files in a directory recursively excluding some subdirectories.

For example, I want to exclude all files under directories named "inbox" in any level.

I can specify which directories I want to include. Is there a way to specify directories I want to exclude?

For example, the following command opens all .md files in all subdirectories:

args **/*.md

I don't want to open any file under any subdirectory called inbox.

Mert Nuhoglu
  • 9,695
  • 16
  • 79
  • 117

1 Answers1

1

I don't think it is possible to exclude directories/files with the vim glob syntax.

You probably have to use find as an external tool. For example

for i in (split(system("find -name '*.md\' -not -path '*/inbox/*'"),'\n')) | execute("e ".i) | endfor
edi9999
  • 19,701
  • 13
  • 88
  • 127