1
0
mirror of https://github.com/ViViDboarder/shoestrap.git synced 2025-02-28 07:53:58 +00:00
2020-10-05 09:32:59 -07:00

17 lines
564 B
Fish

# A function that can be used as the preview function for FZF to make fancy previews with syntax highlighting
function __fzf_preview
if file --mime "$argv" | grep -q binary
echo "$argv is a binary file"
else
if command --quiet --search bat
bat --color=always --line-range :500 "$argv"
else if command --quiet --search chroma
chroma "$argv" | head -250
else if command --quiet --search coderay
coderay "$argv" | head -250
else
head -250 "$argv"
end
end
end