fzf Reload, Event Bindings, and Dynamic Sources/Switch between multiple data sources

Bind keys that swap the prompt and reload command.

Section: Reload patterns

Switch between multiple data sources

bash
bash
printf '%s\n' files dirs | fzf --prompt='Files> ' --bind 'ctrl-d:change-prompt(Dirs> )+reload(fd --type d),ctrl-f:change-prompt(Files> )+reload(fd --type f)'
Explanation

Useful for command palettes that have multiple modes.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Reload patterns
Reload a process list on demand
Refresh the data source with a key binding.
OpenIn sheetbashsame section
Use fzf as a frontend for ripgrep
Run a new ripgrep search whenever the query changes.
OpenIn sheetbashsame section
Refresh a changing preview
Force the preview command to rerun.
OpenIn sheetbashsame section
Rewrite the query dynamically
Change the query from a binding.
Update preview label dynamically
Show context-sensitive labels as focus moves.