Skip to content

Instantly share code, notes, and snippets.

@pbt001
Forked from BaseCase/fuz.sh
Created February 20, 2019 21:47
Show Gist options
  • Save pbt001/cc86f3561f3d845ffd32b79663a7be5c to your computer and use it in GitHub Desktop.
Save pbt001/cc86f3561f3d845ffd32b79663a7be5c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
main() {
previous_file="$1"
file_to_edit=`select_file $previous_file`
if [ -n "$file_to_edit" ] ; then
"$EDITOR" "$file_to_edit"
main "$file_to_edit"
fi
}
select_file() {
given_file="$1"
fzf --preview="cat {}" --preview-window=right:70%:wrap --query="$given_file"
}
main ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment