fzf - .gitignore node_modules/ 不适用于 fd 和 ripgrep
问题描述
我正在尝试在 Windows 10 上为 vim设置fzf.vim 。
您可以使用应该尊重 .gitignore的替代 find 命令,例如ripgrep或fd。
我的 .gitignore 文件有这一行,它适用于 git 提交等:
node_modules/
我的目录结构是
/working directory
.gitignore file
.git dir
/node_modules dir
当我跑
fd --type f
或者
rg --files
它列出了 node_modules 中的所有文件。
我觉得这可能是一个Windows问题。
如何让这些程序使用 .gitignore 来忽略 node_modules?
解决方案
原来,我正在使用一个尚未初始化 git repo 的项目。所以我有一个 .gitignore,但没有 .git 文件夹。默认情况下,ripgrep 需要它是一个实际的 git 存储库才能使用 .gitiginore 文件夹。我的解决方案是使用以下标志 -
--no-require-git
推荐阅读
- swift - 如何强制 Swift 识别撇号?
- jenkins - Jenkins Pipeline:遍历地图时如何使用 sh 模块?
- python - 抓取屏幕截图后pygame无法播放mp3
- ios - 为什么我的 UIDocumentPickerViewController 返回我无法访问的 url?
- c++ - 对静态字符串向量的未定义引用
- java - 与 post 与 postDelayed 保持时间间隔
- unix - 我如何找到最常用的词 unix
- gtk - 不使用 GtkBuilder 时,搜索在 GtkShortcutsWindow 中不起作用
- rxjs - 刷新页面角度8时丢失数据
- android - 图像未显示在 IONIC 4 的设备中,来自 android 版本 9 及更高版本的服务器