:h starstar-wildcard, but I cannot understand some cases.
(In the following examples, I am using the command
:vimgrep pattern file where "pattern" is contained in the concerned files.)
1- If I have the files
dir/foo.txt and execute
:vimgrep pattern **.txt, only the first file is found. Why?
2- If I have a file
foo.txt and execute
:vimgrep pattern **/*.txt, the pattern is found in the file. I would have expected only files with a
/ in its name would match (so only .txt files in subdirectories). Why is the
** seems to only match files, not directories. Is that right?
I think I am misunderstanding how the
** wildcard really works.