I want to run a function when I start typing in the terminal.
Specifically I want to run the fzf function, for which I currently need to press ctrl-r to trigger it. I would like any keystroke to trigger it so history always appears when I type.
Only the first keystroke should run the function, because running it multiple time toggles between path and filename selection.
bindprobably won't work, as I don't think you can meet the "first keystroke only" requirement. A faux command line with a high speed read loop might work. Using the terminal in raw mode or modifying the bash source code are probably the most likely avenues. Also, consider selector instead of fzf.