Allow kitty to preview images when using ff

This commit is contained in:
David Heinemeier Hansson
2026-03-10 10:50:10 +01:00
parent e5b69c52f8
commit c880e8fbcb
+10 -1
View File
@@ -6,7 +6,16 @@ if command -v eza &> /dev/null; then
alias lta='lt -a'
fi
alias ff="fzf --preview 'bat --style=numbers --color=always {}'"
if [[ "$TERM" == "xterm-kitty" ]]; then
alias ff="fzf --preview '
case \$(file --mime-type -b {}) in
image/*) kitty icat --clear --transfer-mode=memory --stdin=no --place=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES}@0x0 {} ;;
*) bat --style=numbers --color=always {} ;;
esac
'"
else
alias ff="fzf --preview 'bat --style=numbers --color=always {}'"
fi
alias eff='$EDITOR "$(ff)"'
if command -v zoxide &> /dev/null; then