Skip to content

Enable file preview for some file types #3276

Answered by faxotherapy
faxotherapy asked this question in Q&A
Discussion options

You must be logged in to vote

I solved my problem as follows:

  1. Create a function:
    pale() { [[ -n `file "$1" | grep -o text` ]] && glow -p -w 110 -s dark "$1" }
  2. Rewrite fzf option:
    --preview 'zsh -c $(functions pale); pale {}'
    For Bash user, read this.

Inspired by this post.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by faxotherapy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant