title: How to run a function on first keystroke in bash/zsh?
body: <p>I want to run a function when I start typing in the terminal.</p>
  
  <p>Specifically I want to run the <code>fzf</code> function, for which I currently need to press <code>ctrl-r</code> to trigger it. I would like <code>any keystroke to trigger it</code> so history always appears when I type.</p>
  
  <p><code>Only the first keystroke</code> should run the function, because running it multiple time toggles between path and filename selection.</p>