fzf Reload, Event Bindings, and Dynamic Sources

Build live search interfaces with reload, change events, refresh-preview, and mode-switching key bindings.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Reload patterns
Reload a process list on demand
fzf --header-lines=1 --header='CTRL-R to reload' --bind 'ctrl-r:reload(ps -ef)' < <(ps -ef)

# Refresh the data source with a key binding.

Use fzf as a frontend for ripgrep
fzf --ansi --disabled --query '' --bind 'start:reload:rg --column --line-number --no-heading --color=always {q} || true' --bind 'change:reload:rg --column --line-number --no-heading --color=always {q} || true' --delimiter=':' --preview 'bat --color=always --highlight-line {2} {1}'

# Run a new ripgrep search whenever the query changes.

Switch between multiple data sources
printf '%s
' files dirs | fzf --prompt='Files> ' --bind 'ctrl-d:change-prompt(Dirs> )+reload(fd --type d),ctrl-f:change-prompt(Files> )+reload(fd --type f)'

# Bind keys that swap the prompt and reload command.

Refresh a changing preview
fzf --preview 'date' --bind '?:refresh-preview'

# Force the preview command to rerun.

## Transform actions
Rewrite the query dynamically
printf '%s
' alpha beta gamma | fzf --bind 'ctrl-e:transform-query:echo beta'

# Change the query from a binding.

Update preview label dynamically
printf '%s
' a b c | fzf --preview 'echo {}' --bind 'focus:transform-preview-label:echo Preview'

# Show context-sensitive labels as focus moves.

Recommended next

No recommendations yet.