feat(fzf): add preview, dirs, and image support to @@ inline picker

The @@ picker only listed files with no preview. It now lists both
files and directories via fd (matching _fzf_search_directory), and
shows a bat-highlighted or image-rendered preview through
_fzf_preview_file. Image previews use a kitty-graphics-protocol,
chafa, viu, timg fallback chain via the new _fzf_preview_image
helper, benefiting the Ctrl+F directory search and git-status
pickers as well since they share the same preview helper.
This commit is contained in:
2026-08-21 00:46:29 -04:00
parent 7466188d35
commit 616596726d
3 changed files with 63 additions and 4 deletions
+2
View File
@@ -17,6 +17,8 @@ function _fzf_preview_file --description "Print a preview for the given file bas
if set --query fzf_preview_file_cmd
# need to escape quotes to make sure eval receives file_path as a single arg
eval "$fzf_preview_file_cmd '$file_path'"
else if command -q file; and string match -q 'image/*' -- (command file --brief --mime-type -- "$file_path" 2>/dev/null)
_fzf_preview_image "$file_path"
else
bat --style=numbers --color=always "$file_path"
end