Skip to content

Instantly share code, notes, and snippets.



Last active Jul 9, 2019
What would you like to do?
Bash script to preview files with bat for fzf
[[ $(file --mime "$file") =~ binary ]] &&
echo "$file" is a binary file ||
(bat --style=numbers --color=always "$file" ||
highlight -O ansi -l "$file" ||
coderay "$file" ||
rougify "$file" ||
cat "$file") 2> /dev/null | head -500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.