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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user