How to preview images with imgcat on iTerm2? #3609
Answered
by
LangLangBart
glaucocustodio
asked this question in
Q&A
-
Hey guys, I have: $ fzf --version $ imgcat -v and would like to know how should I set up FZF_DEFAULT_OPTS to make fzf preview images with iTerm2's imgcat, currently I've this:
I've tried this but didn't work:
|
Beta Was this translation helpful? Give feedback.
Answered by
LangLangBart
Feb 2, 2024
Replies: 1 comment 4 replies
-
According to the changelog1, the Rather than using the iTerm2
export FZF_DEFAULT_OPTS='
--bind "ctrl-y:execute-silent(echo {+} | pbcopy)"
--bind "ctrl-e:execute(echo {+} | xargs -o code)"
--preview "
if file --mime-type {} | grep -qF image/; then
imgcat --depth iterm2 --width $FZF_PREVIEW_COLUMNS --height $FZF_PREVIEW_LINES {}
else
bat --theme=TwoDark --style=numbers --color=always --line-range :500 {}
fi
"
' Footnotes |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
glaucocustodio
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the changelog1, the
imgcat
functionality was introduced in version 0.44.0.Rather than using the iTerm2
imgcat
script2, it appears you are using eddieantonio'simgcat
3.FZF_DEFAULT_OPTS
as follows:imgcat
script, please remove the--depth iterm2
flag from theFZF_DEFAULT_OPTS
below.