Closed ndavd closed 1 month ago
You can make the file a proper shell script file with execute permission (chmod +x
) and pass {}
as an argument to it and refer to it via $1
in the script.
--preview='$HOME/.config/fzf/preview-script {}'
That worked, thanks!
First of all thank you for the great feature that are custom previews.
Recently I worked on a bit more complex script to add custom previews to a range of filetypes, and it will only grow in complexity as I support more mime types.
As you can see I didn't want to make a huge inline script so I moved it to an external file which I then cat into the
--preview
.Unfortunately I ran into a couple of escaping issues and had to tweak quotes around the script contents. I was wondering how hard would it be to be able to just pass a bash/zsh script there instead of catting the contents of a file that has to be escaped according to the command.