Changing FZF candidate list on the fly
karthink opened this issue · 1 comments
karthink commented
Is there a way to change the list of candidates that fzf is working with from within the selection window itself?
Here is an example of what I mean:
- I press
Alt-c
and start searching through directories. - I realize that I need to search through a different list, such as the history of directories visited in that session (provided by
$dirprev
in fish), or a list obtained by startingfind
from a different root folder. - I want to be able to press a command set with
--bind=alt-r:execute(some-other-fzf-command)
and start there instead.
Another example:
- My
Ctrl-t
command finds files usingfd
, starting at the home directory. - I realize what I'm looking for is actually in /usr/share, so I want to switch to using
locate
by hittingalt-l
.
But calling fzf (with a different source list) from within fzf doesn't seem to work. I realize that calling execute(..)
may be the wrong way to go about it. So is there some recipe to switch sources on the fly without having to leave fzf and invoke a separate command from the shell?
karthink commented
I jumped the gun here. The fzf maintainer explains how to (not) do this:
I got the desired behavior in my examples above by combining the --expect
option and some bash scripting.