Closed Susensio closed 9 months ago
Sorry, I was guarding some part of my config with if not status is-interactive
and that was the problem.
Hi, did you see https://github.com/PatrickF1/fzf.fish/wiki/Troubleshooting#fzf_preview_file_cmd-and-fzf_preview_dir_cmd-not-being-used? How can I reword that so it's easier for people to find?
Well, I think you did well, I just didn't thought of checking the wiki..
I have a conf.d/fzf.fish
file that configures this plugin, and some parts need to be guarded in case I'm bootstraping fisher
# Better dir and file previews
set fzf_preview_dir_cmd preview
set fzf_preview_file_cmd preview
# Edit with nvim on search-directory
set fzf_directory_opts --bind "ctrl-e:execute($EDITOR {} &> /dev/tty)"
# Exclude the command timestamp from the search scope when in Search History
set fzf_history_opts "--nth=4.."
# Make history respect chronological order
set fzf_history_opts --no-sort
# Not neccesary if not interactive, besides this guards on bootstrap
if not status is-interactive
exit
end
# Default bindings but bind Search Directory to Ctrl+F and Search Variables to Ctrl+Alt+V prepending $
fzf_configure_bindings --directory=\cf --variables=
This needs to be guarded because fzf_configure_bindings
does not exist on boostrap until I do a fisher update
For reference, how I bootstrap fisher:
This took me a while to debug. When setting
fzf_preview_file_cmd
andfzf_preview_dir_cmd
as stated in https://github.com/PatrickF1/fzf.fish#change-how-search-directory-previews-directories-and-regular-files example:those settings are not honored. This is because (I think)
_fzf_preview_file
is executed in a subshell byfzf
.I've tried to export those variables:
with no luck