我在file-searching上阅读了Vim的帮助,其中解释了*和**文件搜索操作符(都在下面引用)。虽然我了解到**只匹配目录(默认情况下限制为30个目录)和*匹配所有目录(包括/),但*不理解为什么需要这两个目录,以及每个.的用例是什么。
另外,如何只匹配列出目录中的文件?directory/*也会匹配子目录中的文件(例如directory/subdirectory/),对吗?如果*只匹配列出目录中的文件(没有子目录),那么它们之间的互补不是更好吗?
Vim文件:
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 '**'.发布于 2016-01-05 12:41:11
* 与不匹配https://stackoverflow.com/questions/34611289
复制相似问题