2017-11-29 02:48:44 +00:00
|
|
|
# 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"
|
2019-11-14 18:20:42 +00:00
|
|
|
else
|
|
|
|
coderay "$argv" ;or cat "$argv" 2> /dev/null | head -250
|
2017-11-29 02:48:44 +00:00
|
|
|
end
|
|
|
|
end
|