在所有项目文件中搜索 Vim



有人可以帮我如何在所有项目文件(Windows(中搜索文本吗?

我试过:

vimgrep /user/ **.*

它只找到了 1 个匹配项,但我确定我有 2 个包含"用户"文本的文件。

如果我可以在没有插件或其他程序的情况下做到这一点,那就太好了。

谢谢

**是一个特殊的内置 glob 运算符。如:help starstar中所述,它只能在某些位置使用:

- '**' can only be at the end of the path or be followed by a path
separator or by a number and a path separator.

所以,你需要在两者之间放置一个路径分隔符(/(;如果没有它,Vim 会将每个*都视为 glob 运算符,只搜索当前目录:

:vimgrep /user/ **/.*

最新更新