Replies: 1 comment
-
It depends on what exactly you are trying to achieve. If you have a specific command that should only run when the fzf query changes and should take the fzf query as input, then the following example should give you an idea of how to do it. fzf \
--bind 'change:transform:((#FZF_QUERY)) && echo "reload:seq ${#FZF_QUERY}" || echo "reload(:)"' \
--bind 'start:reload(:)' \
--disabled \
--preview 'seq ${#FZF_QUERY}' \
--with-shell 'zsh -c' On If, for any reason, you want to change fzf's default behavior when it starts, it can be a bit more complicated. The following example works, but the reload causes the input list to refresh using the given command every time you press a key. With a large set of files, you may notice a delay. fzf \
--bind 'start:reload(:)' \
--bind 'change:transform:((#FZF_QUERY)) && echo "reload(</dev/tty FZF_DEFAULT_COMMAND= fzf --filter= --walker file)" || echo "reload(:)"' \
--ghost 'Please enter a search query' \
--prompt "Custom fzf > " \
--with-shell 'zsh -c' The part with Ref: #4062 You can also use a command like more context would be good (my context window is unlimited, but my time to read it isn't) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to make it so that
fzf
show results only if query is not empty, but if it's empty then it shows no results instead of all of them?Beta Was this translation helpful? Give feedback.
All reactions