I've edited $FZF_DEFAULT_COMMAND as following in ~/.bashrc:
export FZF_DEFAULT_COMMAND='ag --nocolor --hidden --ignore .git -g ""'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
Now, as expected running $ fzf from $HOME directory works perfectly. It includes hidden files except all the files inside and and all .git directories. But when I use Ctrl-T for completion in $HOME directory, it also includes errors because some files don't have permissions. For example:
> ERR: Error opening directory ./.gvfs: Permission denied
This error message messes up the output of interactive fzf fuzzy matching. Is there any way I can fix it?
Redirect stderr to /dev/null. i.e. 2> /dev/null
Thanks for this, it was driving me nuts. For completeness, based on junegunn's answer, your CTRL-T command should look like this:
export FZF_CTRL_T_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*" --glob "!node_modules/*" --glob "!vendor/*" 2> /dev/null'
Most helpful comment
Thanks for this, it was driving me nuts. For completeness, based on junegunn's answer, your CTRL-T command should look like this:
export FZF_CTRL_T_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*" --glob "!node_modules/*" --glob "!vendor/*" 2> /dev/null'