fzf command-line fuzzy finder
fzf [options]
fzf is an interactive filter program for any kind of list.
This document contains a list of the many options but, does not describe how to use fzf!
| -x --extended | Extended-search mode. Enabled by default. Disabled with +x or --no-extended.
| ||||||||||||||||||||||||||||||
| -e --exact | Enable exact-match | ||||||||||||||||||||||||||||||
| -i --ignore-case | Case-insensitive match (default: smart-case match) | ||||||||||||||||||||||||||||||
+i |
| --read0 | Read input delimited by ASCII NUL characters instead of newline characters | ||
| --print0 | Print output delimited by ASCII NUL characters instead of newline characters | ||
| --sync | Synchronous search for multi-staged filtering. fzf launches the finder only after the input stream is complete and the initial filtering and the associated actions (bound to any of start, load, result, result-final, or focus) are complete.
Example: # Avoid rendering both fzf instances at the same time fzf --multi | fzf --sync # fzf will not render intermediate states (sleep 1; seq 1000000; sleep 1) | fzf --sync --query 5 --listen --bind start:up,load:up,result:up,focus:change-header:Ready | ||
|
search for the current TTY device via standard error instead of defaulting to | /dev/tty.
Avoids issues when launching emacsclient from within fzf. Alternatively, change the default TTY device by setting --tty-default=DEVICE_NAME.
--ansi | Enable processing of color.
| |
--style=PRESET|
Apply a style preset [default|minimal|full[:BORDER_STYLE]]
| --color=[BASE_SCHEME][,COLOR_NAME[:ANSI_COLOR] | [,ANSI_ATTRIBUTES]]...
Color configuration. The name of the base color scheme is followed by custom color mappings. Each
entry is separated by a comma and/or whitespaces.
| BASE SCHEME:(default: dark on 256-color terminal, otherwise base16; If NO_COLOR is set, bw)
-1 Default terminal foreground/background color
(or the original color of the text)
0 ~ 15 16 base colors,
black, red, green, yellow, blue, magenta, cyan, white,
bright-black (gray | grey)
bright-red, bright-green, bright-yellow, bright-blue,
bright-magenta, bright-cyan, bright-white,
16 ~ 255 ANSI 256 colors
#rrggbb 24-bit colors
ANSI ATTRIBUTES: (Only applies to foreground colors)regular ( strip (Remove colors), bold, underline, underline-double, underline-curly, underline-dotted, underline-dashed, reverse, dim, italic, strikethrough EXAMPLES: # Seoul256 --no-color | Disable colors
| --no-bold | Do not use bold text
| --black | Use black background
| |
--height=[~][-]HEIGHT[%]|
Display fzf window below the cursor with the given height instead of using the full screen.
|
If a negative value is specified, the height is calculated as the terminal height minus the given value.
When prefixed with # Will not take up 100% of the screen seq 5 | fzf --height=~100% # Adapt to input size, up to terminal height minus 1 seq 5 | fzf --height=~-1Adaptive height has the following limitations: * Cannot be used with top/bottom margin and padding given in percent size * It will not find the right size when there are multi-line items
Minimum height when --height is given as a percentage. Add + to automatically increase the value
according to the other layout options so that the specified number of items are visible in the list
section (default: 10+). Ignored when --height is not specified or set as an absolute value.
| --popup[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]][,border-native]] |
Start fzf in a tmux or Zellij floating pane (default center,50%). Requires tmux 3.3+ or Zellij
0.44+. This option is ignored if you are not running fzf inside tmux or Zellij. --tmux is an alias
for this option.
| On tmux 3.7 or above and on Zellij, the floating pane is not modal; you can switch to other panes and windows while fzf is running, and move and resize the pane with the mouse. The native border of the pane is the handle for moving and resizing it, so it is used by default and border-native is implied. --border-label is displayed on the native border, and change-border-label and transform-border-label update it (--border-label-pos is ignored). On tmux, fzf holds the label in the @fzf-border-label option of the pane and sets its pane-border-format to read it back, so the label is displayed if pane-border-status is enabled in tmux. The title of the pane is left alone. On Zellij, the label is the name of the pane. fzf draws its own border instead when a border style is explicitly specified with --border, so that it is the only border shown. none and line are treated as no border. Give border-native to keep the native border nonetheless. On tmux, the fzf-drawn border is shown in a modal popup, since the native border of a tmux floating pane cannot be removed; this is also the case on tmux versions below 3.7. Example: # Popup in the center with 70% width and height fzf --popup 70% # Popup on the left with 40% width and 100% height fzf --popup right,40% # Popup on the bottom with 100% width and 30% height fzf --popup bottom,30% # Popup on the top with 80% width and 40% height fzf --popup top,80%,40% # Popup with a native tmux or Zellij border in the center with 80% width and height fzf --popup center,80%,border-native |
--layout=LAYOUT|
Choose the layout (default: default)
|
default Display from the bottom of the screen
reverse Display from the top of the screen
reverse-list Display from the top of the screen, prompt at the bottom
--reverse |
A synonym for --layout=reverse
| --margin=MARGIN |
Comma-separated expression for margins around the finder. | TRBL Same margin for top, right, bottom, and leftTB,RL Vertical, horizontal marginT,RL,B Top, horizontal, bottom marginT,R,B,L Top, right, bottom, left margin
Each part can be given in absolute number or in percentage relative to the terminal size with % suffix. Example: fzf --margin 10% fzf --margin 1,5%
Comma-separated expression for padding inside the border. Padding is distinguishable from margin
only when --border option is used.
Example:
| fzf --margin 5% --padding 5% --border --preview 'cat {}' \
--color bg:#222222,preview-bg:#333333
TRBL Same padding for top, right, bottom, and leftTB,RL Vertical, horizontal paddingT,RL,B Top, horizontal, bottom paddingT,R,B,L Top, right, bottom, left padding--border[=STYLE] |
Draw border around the finder
|
top (up), bottom (down), left, right, noneIf you use a terminal emulator where each box-drawing character takes 2 columns, try setting --ambidouble. If the border is still not properly rendered, set --no-unicode.
line style draws a single separator line at the top when --height is used.
--border-label[=LABEL] |
Label to print on the horizontal border line. used with one of | --border options.
rounded, sharp, bold, double, horizontal, top (up), bottom (down)
Example:
# ANSI color codes are supported # (with https://github.com/busyloop/lolcat) label=$(curl -s http://metaphorpsum.com/sentences/1 | lolcat -f) # Border label at the center fzf --height=10 --border --border-label="QQQ $label QQQ" --color=label:italic:black # Left-aligned (positive integer) fzf --height=10 --border --border-label="QQQ $label QQQ" --border-label-pos=3 --color=label:italic:black # Right-aligned (negative integer) on the bottom line (:bottom) fzf --height=10 --border --border-label="QQQ $label QQQ" --border-label-pos=-3:bottom --color=label:italic:black
Position of the border label on the border line. | a positive integer as the column position from the left. a negative integer to right-align the label. Label is printed on the top border line by default, add :bottom to put it on the border line on the bottom. The default value center) will put the label at the center of the border line.
|
| -m --multi[=MAX]
Enable multi-select with tab/shift-tab. It optionally takes an integer argument which denotes the
maximum number of items that can be selected.
| +m |
| --no-input | Disable and hide the input section. You can no longer type in queries. To trigger a search, use search action. You can later show the input section using show-input or toggle-input action, and hide it again using hide-input, or toggle-input. | ||||||||||||||||||||
--prompt=STR| Input prompt (default: '> ')
| --info=STYLE |
Determines the display style of the finder info. (Example: match counter, loading indicator, etc.)
| default On the left end of the horizontal separator right On the right end of the horizontal separator hidden Do not display finder info inline After the prompt with the default prefix ' < ' inline:PREFIX After the prompt with a non-default prefix inline-right On the right end of the prompt line inline-right:PREFIX On the right end of the prompt line with a custom prefix --info-command=COMMAND |
Command to generate the finder info line. The command runs synchronously and blocks the UI until
completion, so make sure that it's fast. ANSI color codes are supported. $FZF_INFO variable is set
to the original info text. For additional environment variables available to the command, see the
section ENVIRONMENT VARIABLES EXPORTED TO CHILD PROCESSES.
Example: | # Prepend the current cursor position in yellow fzf --info-command='printf "\x1b[33;1m$FZF_POS\x1b[m/$FZF_INFO QQQ"' --no-info | A synonym for --info=hidden
| --separator=STR |
| strbe repeated to form the horizontal separator on the info line (default: 'QQQ' or '-' depending on --no-unicode).
Unless explicitly specified, the separator is not displayed if the input section is already
visually separated from the list section by a border line (Example: --input-border or --header-border). --no-separator | Do not display horizontal separator on the info line. A synonym for --separator='' | --ghost=TEXT | Ghost text to display when the input is empty
| --filepath-word |
Make word-wise movements and actions respect path separators. affected:
| backward-kill-word, backward-word, forward-word, kill-word
--input-border[=STYLE] |
Draw border around the input section. line style draws a single separator line between the input
section and the list section.
| --input-label[=LABEL] | Label to print on the input border
| --input-label-pos[=N[:top|bottom]] | Position of the input label
| |
--preview=COMMAND|
Execute the given command for the current line and display the result on the preview window. {} in
the command is the placeholder that is replaced to the single-quoted string of the current line. To
transform the replacement string, specify field index expressions between the braces (See FIELD
INDEX EXPRESSION for the details).
Example:
| fzf --preview='head -$LINES {}'
ls -l | fzf --preview="echo user={3} when={-4..-2}; cat {-1}" --header-lines=1
fzf exports $FZF_PREVIEW_LINES and $FZF_PREVIEW_COLUMNS so that they represent the exact size of
the preview window. (It also overrides $LINES and $COLUMNS with the same values but they can be
reset by the default shell, so prefer to refer to the ones with FZF_PREVIEW_ prefix.)
fzf also exports $FZF_PREVIEW_TOP and $FZF_PREVIEW_LEFT so that the preview command can determine the position of the preview window. A placeholder expression starting with + flag will be replaced to the space-separated list of the selected items (or the current item if no selection was made) individually quoted. Example: fzf --multi --preview='head -10 {+}'
git log --oneline | fzf --multi --preview 'git show {+1}'
Similarly, a placeholder expression starting with * flag will be replaced to the space-separated
list of all matched items individually quoted.
Each expression expands to a quoted string, so that it's safe to pass it as an argument to an external command. So you should not manually add quotes around the curly braces. But if you don't want this behavior, you can put r flag (raw) in the expression (Example: {r}, {r1}, etc). Use it with caution as unquoted output can lead to broken commands. When using a field index expression, leading and trailing whitespace is stripped from the replacement string. To preserve the whitespace, use the s flag. A placeholder expression with f flag is replaced to the path of a temporary file that holds the evaluated list. This is useful when you pass a large number of items and the length of the evaluated string may exceed ARG_MAX. Example: # See the sum of all the matched numbers
# This won't work properly without 'f' flag due to ARG_MAX limit.
seq 100000 | fzf --preview "awk '{sum+=\$1} END {print sum}' {*f}"
# Use {+f} to get the selected items as a line-separated list
seq 100 | fzf --multi --bind 'enter:become:cat {+f}'
Also,
* {q} is replaced to the current query string
* {q} can contain field index expressions. Example: {q:1}, {q:2..}, etc.
* {n} is replaced to the zero-based ordinal index of the current item.
Use {+n} if you want all index numbers when multiple lines are selected.
To escape a placeholder pattern by prepending a backslash.
Preview window will be updated even when there is no match for the current query if any of the placeholder expressions evaluates to a non-empty string or {q} is in the command template. fzf can render partial preview content before the preview command completes. ANSI escape sequence for clearing the display (CSI 2 J) is supported, so you can use it to implement preview window that is constantly updating. Example: fzf --preview 'for i in $(seq 100000); do (( i % 200 == 0 )) && printf "\033[2J" echo "$i" sleep 0.01 done'fzf has experimental support for Kitty graphics protocol and Sixel graphics. The following example uses https://github.com/junegunn/fzf/blob/master/bin/fzf-preview.sh script to render an image using either of the protocols inside the preview window. Example: fzf --preview='fzf-preview.sh {}'
--preview-border[=STYLE] |
Short for --preview-window=border-STYLE. line style draws a single separator line between the
preview window and the rest of the interface.
| --preview-label[=LABEL] |
Label to print on the horizontal border line of the preview window. Should be used with one of these
| --preview-window
* border-rounded (default on non-Windows platforms) * border-sharp (default on Windows) * border-bold * border-double * border-dashed * border-block * border-thinblock * border-horizontal * border-top * border-bottom --preview-wrap-sign=INDICATOR |
Indicator for wrapped lines in the preview window. If not set, the value of --wrap-sign is used.
| --preview-label-pos[=N[:top|bottom]] |
Position of the border label on the border line of the preview window. Specify a positive integer
as the column position from the left. Specify a negative integer to right-align the label. Label is
printed on the top border line by default, add :bottom to put it on the border line on the bottom.
The default value 0 (or center) will put the label at the center of the border line.
| --preview-window= | [POSITION], [SIZE [%]] [,border-STYLE] [, [no]wrap] [,wrap-word] [, [no]follow] [, [no]cycle] [, [no]info] [, [no]hidden] [,+SCROLL [OFFSETS] [/DENOM]] [,~HEADER_LINES] [,default] [,<SIZE_THRESHOLD(ALTERNATIVE_LAYOUT)]
POSITION: (default: right), | up, down, left, right, nextDetermines the layout of the preview window.
fzf --preview-window follow --preview 'for i in $(seq 100000); do echo "$i" sleep 0.01 (( i % 300 == 0 )) && printf "\033[2J" done':
# Non-default scroll window positions and sizes
fzf --preview="head {}" --preview-window=up,30%
fzf --preview="file {}" --preview-window=down,1
# Initial scroll offset is set to the line number of each line of
# git grep output *minus* 5 lines (-5)
git grep --line-number '' |
fzf --delimiter : --preview 'nl {1}' --preview-window '+{2}-5'
# Preview with bat, matching line in the middle of the window below
# the fixed header of the top 3 lines
#
# ~3 Top 3 lines as the fixed header
# +{2} Base scroll offset extracted from the second field
# +3 Extra offset to compensate for the 3-line header
# /2 Put in the middle of the preview area
#
git grep --line-number '' |
fzf --delimiter : \
--preview 'bat --style=full --color=always --highlight-line {2} {1}' \
--preview-window '~3,+{2}+3/2'
# Display top 3 lines as the fixed header
fzf --preview 'bat --style=full --color=always {}' --preview-window '~3'
fzf --preview 'cat {}' --preview-window \
'right,border-left,<30(up,30%,border-bottom)'
|
--header=STR|
The given string will be printed as the sticky header. The lines are displayed in the given order
from top to bottom regardless of --layout option, and are not affected by --with-nth. ANSI color
codes are processed even when --ansi is not set.
| --header-lines=N |
The first N lines of the input are treated as the sticky header. When --with-nth is set, the lines
are transformed just like the other lines that follow.
| --header-first |
Print header before the prompt line. When both normal header and header lines (--header-lines) are
present, this applies only to the normal header.
| --header-border[=STYLE] |
Draw border around the header section. line style draws a single separator line between the header
window and the list section. inline style embeds the header inside the list border frame, joined to
the list section by a horizontal separator; it requires a --list-border shape that has both top and
bottom segments (rounded / sharp / bold / double / dashed / block / thinblock / horizontal) and
falls back to line otherwise. When the list border also has side segments, the separator joins them
with T-junctions; horizontal has no side borders, so the separator is drawn without T-junction
endpoints. Takes precedence over --header-first (the section stays inside the list frame), and when
--header-lines is also set --header-lines-border must also be inline.
| --header-label[=LABEL] |
Label to print on the header border
| --header-label-pos[=N[:top|bottom]] |
Position of the header label
| --header-lines-border[=STYLE] |
Display header from --header-lines with a separate border. Pass none to still separate the header
lines but without a border. To combine two headers, use --no-header-lines-border. line style draws
a single separator line between the header lines and the list section. inline style embeds the
header lines inside the list border frame with a horizontal separator; it requires a --list-border
shape that has both top and bottom segments, falls back to line otherwise.
| |
--footer=STR|
The given string will be printed as the sticky footer. The lines are displayed in the given order
from top to bottom regardless of --layout option, and are not affected by --with-nth. ANSI color
codes are processed even when --ansi is not set.
| --footer-border[=STYLE] |
Draw border around the footer section. line style draws a single separator line between the footer
and the list section. inline style embeds the footer inside the list border frame with a horizontal
separator; it requires a --list-border shape that has both top and bottom segments and falls back
to line otherwise.
| --footer-label[=LABEL] | Label to print on the footer border
| --footer-label-pos[=N[:top|bottom]] |
Position of the footer label
| SCRIPTING-q | --query=STR Start the finder with the given query
| -1 | --select-1 If there is only one match for the initial query (--query), do not start interactive finder and automatically select the only match
| -0 | --exit-0
If there is no match for the initial query (--query), do not start interactive finder and exit immediately
| -f | --filter=STR
Filter mode. Do not start interactive finder. When used with --no-sort, fzf becomes a fuzzy-version of grep.
| --print-query | Print query as the first line
| --expect=KEY[,..] |
Comma-separated list of keys that can be used to complete fzf in addition to the default enter key.
When this option is set, fzf will print the name of the key pressed as the first line of its output
(or as the second line if --print-query is also used). The line will be empty if fzf is completed
with the default enter key. If --expect option is specified multiple times, fzf will expect the
union of the keys. --no-expect will clear the list.
Example:
| fzf --expect=ctrl-v,ctrl-t,alt-s --expect=f1,f2,~,@This option is not compatible with --bind on the same key and will take precedence over it. To combine the two, use print action. Example: fzf --multi \ --bind 'enter:print()+accept,ctrl-y:select-all+print(ctrl-y)+accept' --no-clear |
Do not clear finder interface on exit. If fzf was started in full screen mode, it will not switch
back to the original screen, so you'll have to manually run tput rmcup to return. This option can
be used to avoid flickering of the screen when your application needs to start fzf multiple times
in order. (Note that in most cases, it is preferable to use reload action instead.)
Example:
| foo=$(seq 100 | fzf --no-clear) || ( # Need to manually switch back to the main screen when cancelled tput rmcup exit 1 ) && seq "$foo" 100 | fzf |
--with-shell=STR|
Shell command and flags to start child processes with. On *nix Systems, the default value is $SHELL
-c if $SHELL is set, otherwise sh -c. On Windows, the default value is cmd /s/c when $SHELL is not
set.
| --listen[=SOCKET_PATH|[ADDR:]PORT] --listen-unsafe[=[ADDR:]PORT] |
Start HTTP server and listen on the given address or Unix socket. It allows external processes to
send actions to perform via POST method and query the program state via GET method. For the
argument to be recognized as a socket path, it must have .sock extension.
|
# Start HTTP server on port 6266
fzf --listen 6266
# Send action to the server
curl -XPOST localhost:6266 -d 'reload(seq 100)+change-prompt(hundred> )'
# Start HTTP server on port 6266 with remote connections allowed
# * Listening on non-localhost address requires using an API key
export FZF_API_KEY="$(head -c 32 /dev/urandom | base64)"
fzf --listen 0.0.0.0:6266
# Send an authenticated action
curl -XPOST localhost:6266 -H "x-api-key: $FZF_API_KEY" -d 'change-query(yo)'
# Choose port automatically and export it as $FZF_PORT to the child process
fzf --listen --bind 'start:execute-silent:echo $FZF_PORT > /tmp/fzf-port'
# Get program state in JSON format (experimental)
# - GET Parameters:
# - limit: number of items to return (default: 100)
# - offset: number of items to skip (default: 0)
curl localhost:6266
# Automatically select items with .txt extension
fzf --multi --sync --listen --bind 'load:transform:
pos=1
curl -s localhost:$FZF_PORT?limit=1000 | jq -r .matches[].text | while read -r text; do
if [[ $text =~ \.txt$ ]]; then
echo -n "+pos($pos)+select"
fi
pos=$((pos + 1))
done
echo +first
'
Here is an example script that uses a Unix socket instead of a TCP port.
fzf --listen=/tmp/fzf.sock # GET curl --unix-socket /tmp/fzf.sock http # POST curl --unix-socket /tmp/fzf.sock http -d up --threads=N | Number of matcher threads to use. The default value is min(8 * NUM_CPU, 32).
| --bench=DURATION |
Repeatedly run --filter for the given duration and print timing statistics. Must be used with
--filter.
Example:
| cat /usr/share/dict/words | fzf --filter abc --bench 10s |
--walker=[file][,dir][,follow][,hidden]|
Determines the behavior of the built-in directory walker that is used when $FZF_DEFAULT_COMMAND is
not set. The default value is file,follow,hidden.
| * file: Include files in the search result * dir: Include directories in the search result * hidden: Include and follow hidden directories * follow: Follow symbolic links --walker-root=DIR [...] |
List of directory names to start the built-in directory walker. The default value is the current working directory.
| --walker-skip=DIRS |
Comma-separated list of directory names to skip during the directory walk. The default | .git,node_modules.
|
--history=HISTORY_FILE|
Load search history from the specified file and update the file on completion. When enabled,
CTRL-N and CTRL-P are automatically remapped to next-history and prev-history.
| --history-size=N |
Maximum number of entries in the history file (default: 1000). The file is automatically truncated
when the number of the lines exceeds the value.
Example: gem list | fzf --with-shell 'ruby -e' --preview 'pp Gem::Specification.find_by_name({1})'
| |
| --bash | Print script to set up Bash shell integration
Example: eval "$(fzf --bash)" |
| --zsh | Print script to set up Zsh shell integration
Example:l source <(fzf --zsh) |
| --fish | Print script to set up Fish shell integration
Example:fzf --fish | source |
| --nushell | Print script to set up Nushell shell integration
Example:fzf --nushell | save -f ~/.config/nushell/autoload/_fzf_integration.nu |
| --no-mouse | Disable mouse |
| --no-unicode | Use ASCII characters instead of Unicode drawing characters to draw borders, the spinner and the horizontal separator. |
| --ambidouble | Set this option if your terminal displays ambiguous width characters (Example: box-drawing characters for borders) as 2 columns. |
| --version | Display version information and exit |
| --help | Show help message |
| --man | Show man page |
$FZF_DEFAULT_COMMAND |
0 |
1 The 1st field 2 The 2nd field -1 The last field -2 The 2nd to last field 3..5 From the 3rd field to the 5th field 2.. From the 2nd field to the last field ..-3 From the 1st field to the 3rd to the last field .. All the fields
$FZF_LINES |
$FZF_CURRENT_ITEM is omitted when the item contains a NUL byte, because exec(2) cannot pass it. It is also
omitted when the item is larger than 64 KB, so that a huge item cannot overflow the environment size limit
and break preview and other child commands.
| Exact-match (quoted) | A term that is prefixed by a single-quote character (') is interpreted as an "exact-match" (or "non-fuzzy") term. fzf will search for the exact occurrences of the string. |
| Anchored-match | A term can be prefixed by ^, or suffixed by $ to become an anchored-match term. Then fzf will search for the lines that start with or end with the given string. An anchored-match term is also an exact-match term. |
| Exact-boundary-match (quoted both ends) | A single-quoted term is interpreted as an "exact-boundary-match". fzf will search for the exact occurrences of the string with both ends at the word boundaries. Unlike in regular expressions, this also sees an underscore as a word boundary. But the words around underscores are ranked lower and appear later in the result than the other words around the other types of word boundaries. 1. xxx foo xxx (highest score) 2. xxx foo_xxx 3. xxx_foo xxx 4. xxx_foo_xxx (lowest score) |
| Negation | If a term is prefixed by !, fzf will exclude the lines that satisfy the term from the result. In this case, fzf performs exact match by default. |
| Exact-match by default | If you don't prefer fuzzy matching and do not wish to "quote" (prefixing with ') every word, start fzf with -e or --exact option. Note that when --exact is set, '-prefix "unquotes" the term. |
| OR operator | A single bar character term acts as an OR operator. For example, the following query matches entries that start with core and end with either go, rb, or py. Example: ^core go$ | rb$ | py$ |
KEY1,KEY2,EVENT1,EVENT2:ACTION.Example:
fzf --bind=ctrl-j:accept,ctrl-k:kill-line
# Load 'ps -ef' output on start and reload it on CTRL-R
fzf --bind 'start,ctrl-r:reload:ps -ef'
ctrl-[a-z]
ctrl-space
ctrl-delete
ctrl-\
ctrl-]
ctrl-^ (ctrl-6)
ctrl-/ (ctrl-_)
ctrl-alt-[a-z] (ctrl-alt-h is ctrl-alt-backspace
| ||||||||||||||||||||
start |
abort ctrl-c ctrl-g ctrl-q esc
accept enter double-click
accept-non-empty (same as accept except that it prevents fzf from exiting without
selection)
accept-or-print-query (same as accept except that it prints the query when there's no match)
backward-char ctrl-b left
backward-delete-char ctrl-h ctrl-bspace bspace
backward-delete-char/eof (same as backward-delete-char except aborts fzf if query is empty)
backward-kill-subword
backward-kill-word alt-bs
backward-subword
backward-word alt-b shift-left alt-left
become(...) (replace fzf process with the specified command; see below for the
details)
beginning-of-line ctrl-a home
bell (ring the terminal bell)
best (move to the best match; same as first if raw mode is disabled)
bg-cancel (cancel background transform processes)
cancel (clear query string if not empty, abort fzf otherwise)
change-border-label(...) (change --border-label to the given string)
change-ghost(...) (change ghost text to the given string)
change-header(...) (change header to the given string; doesn't affect --header-lines)
change-header-lines(N) (change the number of --header-lines)
change-header-label(...) (change --header-label to the given string)
change-input-label(...) (change --input-label to the given string)
change-list-label(...) (change --list-label to the given string)
change-multi (enable multi-select mode with no limit)
change-multi(...) (enable multi-select mode with a limit or disable it with 0)
change-nth(...) (change --nth option; rotate through the multiple options separated by
'|')
change-with-nth(...) (change --with-nth option; rotate through the multiple options separated
by '|')
change-pointer(...) (change --pointer option)
change-preview(...) (change --preview option)
change-preview-label(...) (change --preview-label to the given string)
change-preview-window(...) (change --preview-window option; rotate through the multiple option sets
separated by '|')
change-prompt(...) (change prompt to the given string)
change-query(...) (change query string to the given string)
clear-screen ctrl-l
clear-multi (clear multi-selection)
close (close preview window if open, abort fzf otherwise)
clear-query (clear query string)
delete-char del
delete-char/eof ctrl-d (same as delete-char except aborts fzf if query is empty)
deselect
deselect-all (deselect all matches; to also clear non-matching selections, use
clear-multi)
disable-raw (disable raw mode)
disable-search (disable search functionality)
down ctrl-j down
down-match ctrl-n alt-down (move to the match below the cursor)
down-selected (move to the selected item below the cursor)
enable-raw (enable raw mode)
enable-search (enable search functionality)
end-of-line ctrl-e end
exclude (exclude the current item from the result)
exclude-multi (exclude the selected items or the current item from the result)
execute(...) (see below for the details)
execute-silent(...) (see below for the details)
first (move to the first match; same as pos(1))
forward-char ctrl-f right
forward-subword
forward-word alt-f shift-right alt-right
ignore
jump (EasyMotion-like 2-keystroke movement)
kill-line
kill-subword
kill-word alt-d
last (move to the last match; same as pos(-1))
next-history (ctrl-n on --history)
next-selected (synonym to down-selected)
page-down pgdn
page-up pgup
half-page-down
half-page-up
hide-header
hide-input
hide-preview
offset-down (similar to CTRL-E of Vim)
offset-up (similar to CTRL-Y of Vim)
offset-middle (place the current item is in the middle of the screen)
pos(...) (move cursor to the numeric position; negative number to count from the
end)
prev-history (ctrl-p on --history)
prev-selected (synonym to up-selected)
preview(...) (see below for the details)
preview-down shift-down
preview-up shift-up
preview-page-down
preview-page-up
preview-half-page-down
preview-half-page-up
preview-bottom
preview-top
print(...) (add string to the output queue and print on normal exit)
put (put the character to the prompt)
put(...) (put the given string to the prompt)
refresh-preview
rebind(...) (rebind bindings after unbind)
reload(...) (see below for the details)
reload-sync(...) (see below for the details)
replace-query (replace query string with the current selection)
search(...) (trigger fzf search with the given string)
select
select-all (select all matches)
show-header
show-input
show-preview
toggle (right-click)
toggle-all (toggle all matches)
toggle-in (--layout=reverse* ? toggle+up : toggle+down)
toggle-out (--layout=reverse* ? toggle+down : toggle+up)
toggle-bind
toggle-header
toggle-hscroll
toggle-input
toggle-multi-line
toggle-preview
toggle-preview-wrap
toggle-preview-wrap-word
toggle-raw (toggle raw mode for displaying non-matching items)
toggle-search (toggle search functionality)
toggle-sort
toggle-track (toggle global tracking option (--track))
toggle-track-current (toggle tracking of the current item)
toggle-wrap
toggle-wrap-word ctrl-/ alt-/
toggle+down ctrl-i (tab)
toggle+up btab (shift-tab)
track-current (track the current item; automatically disabled if focus changes)
transform(...) (transform states using the output of an external command)
transform-border-label(...) (transform border label using an external command)
transform-ghost(...) (transform ghost text using an external command)
transform-header(...) (transform header using an external command)
transform-header-lines(...) (transform the number of --header-lines using an external command)
transform-header-label(...) (transform header label using an external command)
transform-input-label(...) (transform input label using an external command)
transform-list-label(...) (transform list label using an external command)
transform-nth(...) (transform nth using an external command)
transform-with-nth(...) (transform with-nth using an external command)
transform-pointer(...) (transform pointer using an external command)
transform-preview-label(...) (transform preview label using an external command)
transform-prompt(...) (transform prompt string using an external command)
transform-query(...) (transform query string using an external command)
transform-search(...) (trigger fzf search with the output of an external command)
trigger(...) (trigger actions bound to a comma-separated list of keys and events)
unbind(...) (unbind bindings)
unix-line-discard ctrl-u
unix-word-rubout ctrl-w
untrack-current (stop tracking the current item; no-op if global tracking is enabled)
wait (block action execution until search completes)
up ctrl-k up
up-match ctrl-p alt-up (move to the match above the cursor)
up-selected (move to the selected item above the cursor)
yank ctrl-y
Each transform* action has a corresponding bg-transform* variant that runs the command in the background.
fzf --multi --bind 'ctrl-a:select-all+accept' fzf --multi --bind 'ctrl-a:select-all' --bind 'ctrl-a:+accept'Any action after a terminal action that exits fzf, such as accept or abort, is ignored.
fzf --bind 'ctrl-a:change-prompt(NewPrompt> )'
fzf --bind 'ctrl-v:preview(cat {})' --preview-window hidden>
If the argument contains parentheses, fzf may fail to parse the expression. In that case, you can use any
of the following alternative notations to avoid parse errors.
action-name[...]
action-name{...}
action-name<...>
action-name~...~
action-name!...!
action-name@...@
action-name#...#
|
samp>fzf --bind "enter:execute(less {})"
You can use the same placeholder expressions as in --preview.
fzf switches to the alternate screen when executing a command. However, if the command is expected to
complete quickly, and you are not interested in its output, you might want to use execute-silent instead,
which silently executes the command without the switching. Note that fzf will not be responsive until the
command is complete. For asynchronous execution, start your command as a background process (i.e. appending &).
On *nix systems, fzf runs the command with $SHELL -c
if SHELL is set, otherwise with sh -c, so in this case make sure that the command is POSIX-compliant.
become(...) action is similar to execute(...), but it replaces the current fzf process with the specified
command using execve(2) system call.
fzf --bind "enter:become(vim {})"
reload(...) action is used to dynamically update the input list without restarting fzf. It takes the same
command template with placeholder expressions as execute(...).
See https://github.com/junegunn/fzf/issues/1750 for more info.
Example:
# Update the list of processes by pressing CTRL-R
ps -ef | fzf --bind 'ctrl-r:reload(ps -ef)' --header 'Press CTRL-R to reload' \
--header-lines=1 --layout=reverse
# Integration with ripgrep
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY="foobar"
FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \
fzf --bind "change:reload:$RG_PREFIX {q} || true" \
--ansi --disabled --query "$INITIAL_QUERY"
reload-sync(...) is a synchronous version of reload that replaces the list only when the command is
complete. This is useful when the command takes a while to produce the initial output and you don't want
fzf to run against an empty list while the command is running.
Example:
# You can still filter and select entries from the initial list for 3 seconds
seq 100 | fzf --bind 'load:reload-sync(sleep 3; seq 1000)+unbind(load)'
fzf --bind 'focus:transform-header:file --brief {}'
transform(...) action runs an external command that should print a series of actions to be performed. The
output should be in the same format as the payload of HTTP POST request to the --listen server.
Example:
# Disallow selecting an empty line
printf "1. Hello\n2. Goodbye\n\n3. Exit" |
fzf --height '~100%' --reverse --header 'Select one' \
--bind 'enter:transform:[[ -n {} ]] &&
echo accept ||
echo "change-header:Invalid selection"'
A common mistake when writing a transform action is not escaping placeholder expressions when passing them
back to fzf. In the following example, if you don't escape {}, fzf will immediately replace it with the
single-quoted string of the current item. This causes single quotes to appear in the header and footer,
and the script will break if any item contains double-quote characters.
fzf --bind 'focus:transform:[[ $FZF_ACTION =~ up ]] &&
echo "change-header()+transform-footer:echo \{}" ||
echo "change-footer()+transform-header:echo \{}"'
fzf --bind 'start:change-query(foo)+wait+best'In this example, change-query(foo) starts an asynchronous search for the new query, wait blocks until the search completes, and best then moves the cursor to the best match in the complete result set.
The initial loading of the input is also considered a search in progress, so start:wait can be used to block until the input is fully loaded and searched.
While waiting, user input is ignored, except for keys bound to abort or cancel (ctrl-c, ctrl-g, ctrl-q, and esc by default), which cancel the wait and discard the pending actions instead of performing their usual role. The remaining actions of such a binding still run, so a binding like esc:cancel+first is possible.
Asynchronous bg-transform-* actions are not affected; their results are applied as soon as they arrive, even while waiting. For the same reason, wait does not pair with them: in bg-transform-query(...)+wait, the background command completes only after wait has already been evaluated, so the search its result eventually triggers is not waited for. Use the synchronous transform-query(...) variant instead when chaining with wait.
If the search takes long enough, fzf indicates that it is waiting by dimming the input, hiding the cursor, and showing (..) on the info line. This visual feedback is debounced so that quick searches do not cause flickering.
when searches are triggered in rapid succession (Example: via --listen), wait may unblock on the completion of an earlier search. Also, if the input source never completes, wait will block until cancelled.
preview(...) action, you can specify multiple different preview commands in addition to the default
preview command given by --preview .Example:
# Default preview command with an extra preview binding
fzf --preview 'file {}' --bind '?:preview:cat {}'
# A preview binding with no default preview command
# (Preview window is initially empty)
fzf --bind '?:preview:cat {}'
# Preview window hidden by default, it appears when you first hit '?'
fzf --bind '?:preview:cat {}' --preview-window hidden
:# Rotate through the options using CTRL-/
fzf --preview 'cat {}' --bind
'ctrl-/:change-preview-window(right,70%|down,40%,border-horizontal|hidden|right)'
# The default properties given by `--preview-window` are inherited, so an empty string in the list is
interpreted as the default
fzf --preview 'cat {}' --preview-window 'right,40%,border-left' --bind
'ctrl-/:change-preview-window(70%|down,border-top|hidden|)'
# This is equivalent to toggle-preview action
fzf --preview 'cat {}' --bind 'ctrl-/:change-preview-window(hidden|)'
Extra Vim plugin: https://github.com/junegunn/fzf.vim
LICENSE MIT fzf 0.74.2 Aug 2026 fzf(1)
brew install fzf = Downloading Homebrew API data XX JSON API packages.arm64_tahoe.jws.json Downloaded 15.6MB/ 15.6MB = Downloading bottle manifests XX Bottle Manifest fzf (0.74.2) Downloaded 16.8KB/ 16.8KB ==> Would install 1 formula: fzf ==> Fetching downloads for: fzf XX Bottle fzf (0.74.2) Downloaded 2.0MB/ 2.0MB ==> Pouring fzf--0.74.2.arm64_tahoe.bottle.tar.gz ==> Caveats To set up shell integration, see: https://github.com/junegunn/fzf#setting-up-shell-integration To use fzf in Vim, add the following line to your .vimrc: set rtp+=/opt/homebrew/opt/fzf ==> Summary XX /opt/homebrew/Cellar/fzf/0.74.2: 19 files, 5.1MB