Skip to content

Instantly share code, notes, and snippets.

@buzztaiki
Created September 30, 2020 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buzztaiki/8e43975ffc089f8621ca605b911026b7 to your computer and use it in GitHub Desktop.
Save buzztaiki/8e43975ffc089f8621ca605b911026b7 to your computer and use it in GitHub Desktop.
preview filtering results interactively using fzf
#!/bin/bash
cmd="${*}"
input=$(mktemp)
trap "rm -f $input" EXIT
cat > $input
echo '' | fzf --phony --preview-window='up:90%' --print-query --preview "cat $input | ($cmd)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment