How do I remove Library and Music from searching with Ripgrep and FZF?

261 Views Asked by At

I'm trying to configure rg and fzf on my mac, but really cannot work out how to clear out lots of annoying files from search.

I have a ~/.gitignore with the following:

Library/*
Music/*

(and I also tried without the '*' at the end of the line)

and my zshrc looks like this:

export FZF_DEFAULT_COMMAND='rg --files --hidden'

I've also tried putting globs in ~/.ignore and ~/.config/git/ignore. In every case, I always end up with loads of Library/ and Music/ matches.

Any help would be appreciated!! Thank you.

EDIT

With some further Googling I've discovered that it's actually not FZF that isn't working - it's that I'm using Ctrl+T to open fzf. If I type fzf it works as expected.

So the question now is how I can get Ctrl+T to have the correct behaviour.

1

There are 1 best solutions below

0
feoh On

After examining the source code, my hackish answer to this is to add:

export FZF_CTRL_T_COMMAND=$FZF_DEFAULT_COMMAND

to my .zshrc after oh my zsh is sourced.

Hope this helps!