Reputation: 6911
I read Vim's help on file-searching
where *
and **
file searching operators are explained (both cited below). While I grasp that **
matches only directories (with limitation of 30 directories deep by default) and *
matches everything (including /
), I don't think I understand why there is a need for both of them and what are the use cases for each.
Also, how to match only the files in the listed directory? directory/*
would match files in subdirectories (e.g. directory/subdirectory/
) as well, right? Wouldn't they compliment each other better if *
would match only files in the listed directory (without subdirectories)?
Vim documentation:
The usage of '*' is quite simple: It matches 0 or more characters. In a
search pattern this would be ".*". Note that the "." is not used for file
searching.
'**' is more sophisticated:
- It ONLY matches directories.
- It matches up to 30 directories deep by default, so you can use it to
search an entire directory tree
- The maximum number of levels matched can be given by appending a number
to '**'.
Upvotes: 2
Views: 786
Reputation: 76236
*
does not match /
.Upvotes: 2