This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fzf improvement to preview content from files | |
function fzf-lovely(){ | |
fzf -m --preview '[[ $(file --mime {}) =~ binary ]] && | |
echo {} is a binary file || | |
(bat --style=numbers --color=always {} || | |
highlight -O ansi -l {} || | |
coderay {} || | |
rougify {} || | |
cat {}) 2> /dev/null | head -500' | |
} |