Admittedly the usecase is minimal... but "--preview 'declare -f {}'" gives undesired results if it is passed a bash function that is not in the bashrc (even if the bashrc sources the other file). It seems to be because fzf runs these in a non-login shell. This would be convenient for editing bash functions by allowing you to search for all your bash functions and then display the bash code in the preview window.
Bash functions are not visible to child processes if you don't explicitly export them.
> foo() { echo foo; }
> declare -f foo
foo ()
{
echo foo
}
> bash -c 'declare -f foo'
> export -f foo
> bash -c 'declare -f foo'
foo ()
{
echo foo
}
Or you can load your configuration files in preview command
fzf --preview 'source ~/.bashrc; declare -f {}'
Most helpful comment
Bash functions are not visible to child processes if you don't explicitly export them.