fzf Actions Reference
Complete reference for all bindable actions in fzf.
Table of Contents
Action Syntax
Basic Binding
Chaining Actions
Action Arguments
Alternative delimiters for arguments with parentheses:
Selection Actions
| Action |
Default Binding |
Description |
accept |
enter, double-click |
Accept current selection and exit |
accept-non-empty |
- |
Accept only if selection is not empty |
accept-or-print-query |
- |
Accept, or print query if no match |
abort |
ctrl-c, ctrl-g, ctrl-q, esc |
Abort and exit |
cancel |
- |
Clear query if not empty, abort otherwise |
close |
- |
Close preview if open, abort otherwise |
Cursor Movement
Basic Movement
| Action |
Default Binding |
Description |
up |
ctrl-k, up |
Move cursor up |
down |
ctrl-j, down |
Move cursor down |
first |
- |
Move to first match |
last |
- |
Move to last match |
best |
- |
Move to best match |
pos(N) |
- |
Move to position N (negative counts from end) |
Match Navigation
| Action |
Default Binding |
Description |
up-match |
ctrl-p, alt-up |
Move to match above cursor |
down-match |
ctrl-n, alt-down |
Move to match below cursor |
up-selected |
- |
Move to selected item above |
down-selected |
- |
Move to selected item below |
Page Movement
| Action |
Default Binding |
Description |
page-up |
pgup |
Page up |
page-down |
pgdn |
Page down |
half-page-up |
- |
Half page up |
half-page-down |
- |
Half page down |
offset-up |
- |
Scroll view up (like Vim's CTRL-Y) |
offset-down |
- |
Scroll view down (like Vim's CTRL-E) |
offset-middle |
- |
Center current item in view |
Preview Actions
Preview Control
| Action |
Default Binding |
Description |
toggle-preview |
- |
Show/hide preview window |
show-preview |
- |
Show preview window |
hide-preview |
- |
Hide preview window |
refresh-preview |
- |
Refresh preview content |
preview(cmd) |
- |
Execute preview command |
Preview Navigation
| Action |
Default Binding |
Description |
preview-up |
shift-up |
Scroll preview up |
preview-down |
shift-down |
Scroll preview down |
preview-page-up |
- |
Preview page up |
preview-page-down |
- |
Preview page down |
preview-half-page-up |
- |
Preview half page up |
preview-half-page-down |
- |
Preview half page down |
preview-top |
- |
Scroll to preview top |
preview-bottom |
- |
Scroll to preview bottom |
toggle-preview-wrap |
- |
Toggle line wrap in preview |
Preview Window Options
| Action |
Description |
change-preview(cmd) |
Change preview command |
change-preview-window(opts) |
Change preview window options |
change-preview-label(str) |
Change preview label |
transform-preview-label(cmd) |
Transform label with command output |
Query Actions
| Action |
Default Binding |
Description |
clear-query |
- |
Clear query string |
change-query(str) |
- |
Set query to string |
replace-query |
- |
Replace query with current selection |
transform-query(cmd) |
- |
Transform query with command output |
search(str) |
- |
Trigger fzf search with string |
transform-search(cmd) |
- |
Search with command output |
Line Editing
| Action |
Default Binding |
Description |
backward-char |
ctrl-b, left |
Move cursor left |
forward-char |
ctrl-f, right |
Move cursor right |
backward-word |
alt-b, shift-left |
Move to previous word |
forward-word |
alt-f, shift-right |
Move to next word |
beginning-of-line |
ctrl-a, home |
Move to line start |
end-of-line |
ctrl-e, end |
Move to line end |
backward-delete-char |
ctrl-h, bspace |
Delete char before cursor |
delete-char |
del |
Delete char at cursor |
backward-kill-word |
alt-bs |
Delete word before cursor |
kill-word |
alt-d |
Delete word after cursor |
kill-line |
- |
Delete to end of line |
unix-line-discard |
ctrl-u |
Delete entire line |
unix-word-rubout |
ctrl-w |
Delete word (Unix style) |
yank |
ctrl-y |
Paste killed text |
put(str) |
- |
Insert string at cursor |
Multi-Select Actions
| Action |
Default Binding |
Description |
toggle |
right-click |
Toggle selection of current item |
toggle+up |
shift-tab |
Toggle and move up |
toggle+down |
tab |
Toggle and move down |
toggle-in |
- |
Toggle based on layout direction |
toggle-out |
- |
Toggle based on layout direction |
select |
- |
Select current item |
deselect |
- |
Deselect current item |
select-all |
- |
Select all matches |
deselect-all |
- |
Deselect all matches |
toggle-all |
- |
Toggle all matches |
clear-multi |
- |
Clear all selections |
change-multi |
- |
Enable multi-select with no limit |
change-multi(N) |
- |
Enable with limit N (0 to disable) |
Display Actions
UI Elements
| Action |
Description |
change-prompt(str) |
Change prompt text |
transform-prompt(cmd) |
Transform prompt with command |
change-header(str) |
Change header text |
transform-header(cmd) |
Transform header with command |
change-border-label(str) |
Change border label |
transform-border-label(cmd) |
Transform border label |
change-list-label(str) |
Change list label |
change-input-label(str) |
Change input label |
change-header-label(str) |
Change header label |
change-ghost(str) |
Change ghost text |
change-pointer(str) |
Change pointer character |
change-nth(expr) |
Change --nth option |
Visibility Toggles
| Action |
Description |
toggle-header |
Toggle header visibility |
show-header |
Show header |
hide-header |
Hide header |
toggle-input |
Toggle input visibility |
show-input |
Show input |
hide-input |
Hide input |
clear-screen |
Clear and redraw screen |
Behavior Toggles
| Action |
Description |
toggle-sort |
Toggle sorting |
toggle-search |
Toggle search functionality |
enable-search |
Enable search |
disable-search |
Disable search |
toggle-wrap |
Toggle line wrap |
toggle-hscroll |
Toggle horizontal scroll |
toggle-track |
Toggle global tracking |
track-current |
Track current item |
toggle-track-current |
Toggle tracking current item |
toggle-raw |
Toggle raw mode |
enable-raw |
Enable raw mode |
disable-raw |
Disable raw mode |
toggle-multi-line |
Toggle multi-line display |
Command Execution
execute()
Run command without leaving fzf:
execute-silent()
Run command silently (no screen switch):
become()
Replace fzf with command (using execve):
Advantages over $(fzf):
- No empty file opened on CTRL-C
- No empty file on enter with no results
- Handles multiple selections with spaces
reload()
Dynamically update input list:
reload-sync()
Synchronous reload (waits for command completion):
print()
Add to output queue (printed on normal exit):
Transform Actions
Transform actions run external commands and use output to modify state.
Basic Transform
Transform Actions List
| Action |
Description |
transform(cmd) |
Run cmd, output is action sequence |
transform-query(cmd) |
Set query to command output |
transform-prompt(cmd) |
Set prompt to command output |
transform-header(cmd) |
Set header to command output |
transform-border-label(cmd) |
Set border label |
transform-preview-label(cmd) |
Set preview label |
transform-list-label(cmd) |
Set list label |
transform-input-label(cmd) |
Set input label |
transform-header-label(cmd) |
Set header label |
transform-ghost(cmd) |
Set ghost text |
transform-pointer(cmd) |
Set pointer |
transform-nth(cmd) |
Set nth option |
transform-search(cmd) |
Trigger search with output |
Background Transform
Each transform has a bg-transform* variant for async execution:
Binding Management
| Action |
Description |
unbind(keys) |
Unbind specified keys/events |
rebind(keys) |
Rebind previously unbound keys |
toggle-bind |
Toggle all custom bindings |
trigger(keys) |
Trigger actions bound to keys |
Example: Mode switching
Events
Events trigger actions automatically based on state changes.
| Event |
Triggered When |
start |
fzf starts (list may not be ready) |
load |
Input stream complete, initial processing done |
change |
Query string changes |
focus |
Focused item changes |
result |
Result list updates |
resize |
Terminal size changes |
one |
Exactly one match |
zero |
No matches |
multi |
Multi-selection changes |
backward-eof |
Backspace on empty query |
jump |
Successfully jumped in jump mode |
jump-cancel |
Jump mode cancelled |
click-header |
Mouse click in header |
click-footer |
Mouse click in footer |
Event Examples
Miscellaneous Actions
| Action |
Description |
ignore |
Do nothing |
bell |
Ring terminal bell |
jump |
EasyMotion-like 2-keystroke movement |
exclude |
Exclude current item from results |
exclude-multi |
Exclude selected items from results |
Environment Variables in Actions
Available in command execution:
| Variable |
Description |
FZF_QUERY |
Current query string |
FZF_ACTION |
Name of last action |
FZF_KEY |
Name of last key pressed |
FZF_PROMPT |
Current prompt string |
FZF_MATCH_COUNT |
Number of matches |
FZF_SELECT_COUNT |
Number of selections |
FZF_TOTAL_COUNT |
Total items |
FZF_POS |
Current position (1-based) |
FZF_LINES |
fzf height in lines |
FZF_COLUMNS |
fzf width in columns |
FZF_PORT |
HTTP server port (with --listen) |