.gitignore node_modules/ 不适用于 fd 和 ripgrep

use*_*757 2 fzf ripgrep vim-fzf

我正在尝试在 Windows 10 上为 vim设置fzf.vim 。

您可以使用替代的 find 命令,如ripgrepfd,它应该尊重 .gitignore

我的 .gitignore 文件有这一行,对于 git 提交等工作正常:

node_modules/
Run Code Online (Sandbox Code Playgroud)

我的目录结构是

/working directory
.gitignore file
.git  dir
/node_modules dir
Run Code Online (Sandbox Code Playgroud)

当我跑步时

fd --type f
Run Code Online (Sandbox Code Playgroud)

或者

rg --files
Run Code Online (Sandbox Code Playgroud)

它列出了node_modules 中的所有文件。

我感觉这可能是windows的问题。

如何让这些程序使用 .gitignore 来忽略 node_modules?

use*_*757 8

事实证明,我正在使用一个 git 存储库尚未初始化的项目。所以我有一个 .gitignore,但没有 .git 文件夹。默认情况下,ripgrep 需要它是一个实际的 git 存储库才能使用 .gitiginore 文件夹。我的解决方案是使用以下标志 -

-- 不需要 git

更多信息请点击此处