Skip to content

Instantly share code, notes, and snippets.

View ilyvsc's full-sized avatar
:shipit:
Oppenmousen

Luis Diaz ilyvsc

:shipit:
Oppenmousen
View GitHub Profile
@ilyvsc
ilyvsc / zshrc.sh
Last active August 10, 2024 14:52
Preview content inside files using `fzf`
# 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'
}