foo() {
echo "bar"
}
export -f foo
fzf --preview "foo"
leads to opened preview window and error msg:
zsh:1: command not found: foo
How can I define my custom function that can be used for generating the preview?
found (ugly) workaround for zsh:
--preview
to its own file - let's call this preview_functions.sh
preview_functions.sh
:
foo() {
echo "bar"
}
fzf --preview "source preview_functions.sh && foo"
..pretty ugly, but now I am getting the bar
in the preview. Thanks F. Hauri for pointing me to a right direction, zsh != bash
This alsow works - https://unix.stackexchange.com/a/406781/26894 but I don't want to mess my .zshenv