Debian Codegraph @

man/man1/fzf.1

raw
1 .ig
2 The MIT License (MIT)
3
4 Copyright (c) 2013-2026 Junegunn Choi
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 THE SOFTWARE.
23 ..
24 .TH fzf 1 "Sep 2026" "fzf 0.74.4" "fzf - a command-line fuzzy finder"
25
26 .SH NAME
27 fzf - a command-line fuzzy finder
28
29 .SH SYNOPSIS
30 fzf [\fIoptions\fR]
31
32 .SH DESCRIPTION
33 fzf is an interactive filter program for any kind of list.
34
35 It implements a "fuzzy" matching algorithm, so you can quickly type in patterns
36 with omitted characters and still get the results you want.
37
38 .SH OPTIONS
39 .SS NOTE
40 .TP
41 Most long options have the opposite version with \fB\-\-no\-\fR prefix.
42
43 .SS SEARCH
44 .TP
45 .B "\-x, \-\-extended"
46 Extended-search mode. Enabled by default. You can disable it with \fB+x\fR or
47 \fB\-\-no\-extended\fR.
48 .TP
49 .B "\-e, \-\-exact"
50 Enable exact-match
51 .TP
52 .B "\-i, \-\-ignore\-case"
53 Case-insensitive match (default: smart-case match)
54 .TP
55 .B "+i, \-\-no\-ignore\-case"
56 Case-sensitive match
57 .TP
58 .B "\-\-smart\-case"
59 Smart-case match (default). In this mode, the search is case-insensitive by
60 default, but it becomes case-sensitive if the query contains any uppercase
61 letters.
62 .TP
63 .B "\-\-literal"
64 Do not normalize latin script letters for matching.
65 .TP
66 .BI "\-\-scheme=" SCHEME
67 Choose scoring scheme tailored for different types of input.
68
69 .RS
70 .B default
71 .RS
72 Generic scoring scheme designed to work well with any type of input.
73 .RE
74 .RE
75
76 .RS
77 .B path
78 .RS
79 Additional bonus point is only given to the characters after path separator.
80 You might want to choose this scheme over \fBdefault\fR if you have many files
81 with spaces in their paths. This also sets \fB\-\-tiebreak=pathname,length\fR,
82 to prioritize matches occurring in the tail element of a file path.
83 .RE
84 .RE
85
86 .RS
87 .B history
88 .RS
89 Scoring scheme well suited for command history or any input where chronological
90 ordering is important. No additional bonus points are given so that we give
91 more weight to the chronological ordering. This also sets
92 \fB\-\-tiebreak=index\fR.
93 .RE
94 .RE
95
96 .RS
97 fzf chooses \fBpath\fR scheme when the input is a TTY device, where fzf would
98 start its built-in walker or run \fB$FZF_DEFAULT_COMMAND\fR, and there is no
99 \fBreload\fR or \fBtransform\fR action bound to \fBstart\fR event. Otherwise,
100 it chooses \fBdefault\fR scheme.
101 .RE
102
103 .TP
104 .BI "\-\-algo=" TYPE
105 Fuzzy matching algorithm (default: v2)
106
107 .br
108 .BR v2 " Optimal scoring algorithm (quality)"
109 .br
110 .BR v1 " Faster but not guaranteed to find the optimal result (performance)"
111 .br
112
113 .TP
114 .BI "\-n, \-\-nth=" "N[,..]"
115 Comma-separated list of field index expressions for limiting search scope.
116 See \fBFIELD INDEX EXPRESSION\fR for the details. When you use this option with
117 \fB\-\-with\-nth\fR, the field index expressions are calculated against the
118 transformed lines (unlike in \fB\-\-preview\fR where fields are extracted from
119 the original lines) because fzf doesn't allow searching against the hidden
120 fields.
121 .TP
122 .BI "\-\-with\-nth=" "N[,..] or TEMPLATE"
123 Transform the presentation of each line using the field index expressions.
124 For advanced transformation, you can provide a template containing field index
125 expressions in curly braces. When you use a template, the trailing delimiter is
126 stripped from each expression, giving you more control over the output.
127 \fB{n}\fR in template evaluates to the zero-based ordinal index of the line.
128
129 .RS
130 e.g.
131 # Single expression: drop the first field
132 echo foo bar baz | fzf --with-nth 2..
133
134 # Use template to rearrange fields
135 echo foo,bar,baz | fzf --delimiter , --with-nth '{n},{1},{3},{2},{1..2}'
136 .RE
137 .RS
138
139 \fBchange\-with\-nth\fR action is only available when \fB\-\-with\-nth\fR is set.
140 When \fB\-\-with\-nth\fR is used, fzf retains the original input lines in memory
141 so they can be re\-transformed on the fly (e.g. \fB\-\-with\-nth ..\fR to keep
142 the original presentation). This increases memory usage, so only use
143 \fB\-\-with\-nth\fR when you actually need field transformation.
144 .RE
145 .TP
146 .BI "\-\-accept\-nth=" "N[,..] or TEMPLATE"
147 Define which fields to print on accept. The last delimiter is stripped from the
148 output. For advanced transformation, you can provide a template containing
149 field index expressions in curly braces. When you use a template, the trailing
150 delimiter is stripped from each expression, giving you more control over the
151 output. \fB{n}\fR in template evaluates to the zero-based ordinal index of the
152 line.
153
154 .RS
155 e.g.
156 # Single expression
157 echo foo bar baz | fzf --accept-nth 2
158
159 # Template
160 echo foo bar baz | fzf --accept-nth 'Index: {n}, 1st: {1}, 2nd: {2}, 3rd: {3}'
161 .RE
162 .TP
163 .B "+s, \-\-no\-sort"
164 Do not sort the result
165 .TP
166 .BI "\-d, \-\-delimiter=" "STR"
167 Field delimiter regex for \fB\-\-nth\fR, \fB\-\-with\-nth\fR, and field index
168 expressions (default: AWK-style)
169 .TP
170 .B "\-\-tail=NUM"
171 Maximum number of items to keep in memory. This is useful when you want to
172 browse an endless stream of data (e.g. log stream) with fzf while limiting
173 memory usage.
174
175 .RS
176 e.g.
177 \fB# Interactive filtering of a log stream
178 tail \-f *.log | fzf \-\-tail 100000 \-\-tac \-\-no\-sort \-\-exact\fR
179 .RE
180 .TP
181 .BI "\-\-disabled"
182 Do not perform search. With this option, fzf becomes a simple selector
183 interface rather than a "fuzzy finder". You can later enable the search using
184 \fBenable\-search\fR or \fBtoggle\-search\fR action.
185 .TP
186 .BI "\-\-tiebreak=" "CRI[,..]"
187 Comma-separated list of sort criteria to apply when the scores are tied.
188 .br
189
190 .br
191 .BR length " Prefers line with shorter length"
192 .br
193 .BR chunk " Prefers line with shorter matched chunk (delimited by whitespaces)"
194 .br
195 .BR pathname " Prefers line with matched substring in the file name of the path"
196 .br
197 .BR begin " Prefers line with matched substring closer to the beginning"
198 .br
199 .BR end " Prefers line with matched substring closer to the end"
200 .br
201 .BR index " Prefers line that appeared earlier in the input stream"
202 .br
203
204 .br
205 - Each criterion should appear only once in the list
206 .br
207 - \fBindex\fR is only allowed at the end of the list
208 .br
209 - \fBindex\fR is implicitly appended to the list when not specified
210 .br
211 - Default is \fBlength\fR (or equivalently \fBlength\fR,index)
212 .br
213 - If \fBend\fR is found in the list, fzf will scan each line backwards
214 .SS INPUT/OUTPUT
215 .TP
216 .B "\-\-read0"
217 Read input delimited by ASCII NUL characters instead of newline characters
218 .TP
219 .B "\-\-print0"
220 Print output delimited by ASCII NUL characters instead of newline characters
221 .TP
222 .B "\-\-ansi"
223 Enable processing of ANSI color codes
224 .TP
225 .B "\-\-sync"
226 Synchronous search for multi-staged filtering. If specified, fzf will launch
227 the finder only after the input stream is complete and the initial filtering
228 and the associated actions (bound to any of \fBstart\fR, \fBload\fR,
229 \fBresult\fR, \fBresult\-final\fR, or \fBfocus\fR) are complete.
230
231 .RS
232 e.g. \fB# Avoid rendering both fzf instances at the same time
233 fzf \-\-multi | fzf \-\-sync
234
235 # fzf will not render intermediate states
236 (sleep 1; seq 1000000; sleep 1) |
237 fzf \-\-sync \-\-query 5 \-\-listen \-\-bind start:up,load:up,result:up,focus:change\-header:Ready\fR
238 .RE
239 .TP
240 .B "\-\-no\-tty\-default"
241 Make fzf search for the current TTY device via standard error instead of
242 defaulting to \fB/dev/tty\fR. This option avoids issues when launching
243 emacsclient from within fzf. Alternatively, you can change the default TTY
244 device by setting \fB--tty-default=DEVICE_NAME\fR.
245
246 .SS GLOBAL STYLE
247 .TP
248 .BI "\-\-style=" "PRESET"
249 Apply a style preset [default|minimal|full[:BORDER_STYLE]]
250 .TP
251 .BI "\-\-color=" "[BASE_SCHEME][,COLOR_NAME[:ANSI_COLOR][:ANSI_ATTRIBUTES]]..."
252 Color configuration. The name of the base color scheme is followed by custom
253 color mappings. Each entry is separated by a comma and/or whitespaces.
254
255 .RS
256 .B BASE SCHEME:
257 (default: \fBdark\fR on 256-color terminal, otherwise \fBbase16\fR; If \fBNO_COLOR\fR is set, \fBbw\fR)
258
259 \fBdark \fRColor scheme for dark terminal
260 \fBlight \fRColor scheme for light terminal
261 \fBbase16 \fRColor scheme using base 16 colors (alias: \fB16\fR)
262 \fBbw \fRNo colors (equivalent to \fB\-\-no\-color\fR)
263
264 .B COLOR NAMES:
265 \fBfg \fRText
266 \fBlist\-fg \fRText in the list section
267 \fBselected\-fg \fRSelected line text
268 \fBpreview\-fg \fRPreview window text
269 \fBbg \fRBackground
270 \fBlist\-bg \fRList section background
271 \fBselected\-bg \fRSelected line background
272 \fBpreview\-bg \fRPreview window background
273 \fBinput\-bg \fRInput window background
274 \fBheader\-bg \fRHeader window background
275 \fBfooter\-bg \fRFooter window background
276 \fBhl \fRHighlighted substrings
277 \fBselected\-hl \fRHighlighted substrings in the selected line
278 \fBcurrent\-fg (fg+) \fRText (current line)
279 \fBcurrent\-bg (bg+) \fRBackground (current line)
280 \fBgutter \fRGutter on the left
281 \fBcurrent\-hl (hl+) \fRHighlighted substrings (current line)
282 \fBalt\-bg \fRAlternate background color to create striped lines
283 \fBalt\-gutter \fRAlternate gutter color to create the striped pattern
284 \fBquery (input\-fg) \fRQuery string
285 \fBghost \fRGhost text (\fB\-\-ghost\fR, \fBdim\fR applied by default)
286 \fBdisabled \fRQuery string when search is disabled (\fB\-\-disabled\fR)
287 \fBinfo \fRInfo line (match counters)
288 \fBborder \fRBorder around the window (\fB\-\-border\fR and \fB\-\-preview\fR)
289 \fBlist\-border \fRBorder around the list section (\fB\-\-list\-border\fR)
290 \fBscrollbar \fRScrollbar
291 \fBseparator \fRHorizontal separator on info line
292 \fBgap\-line \fRHorizontal line on each gap
293 \fBpreview\-border \fRBorder around the preview window (\fB\-\-preview\fR)
294 \fBpreview\-scrollbar \fRScrollbar
295 \fBinput\-border \fRBorder around the input window (\fB\-\-input\-border\fR)
296 \fBheader\-border \fRBorder around the header window (\fB\-\-header\-border\fR)
297 \fBfooter\-border \fRBorder around the footer window (\fB\-\-footer\-border\fR)
298 \fBlabel \fRBorder label (\fB\-\-border\-label\fR, \fB\-\-list\-label\fR, \fB\-\-input\-label\fR, and \fB\-\-preview\-label\fR)
299 \fBlist\-label \fRBorder label of the list section (\fB\-\-list\-label\fR)
300 \fBpreview\-label \fRBorder label of the preview window (\fB\-\-preview\-label\fR)
301 \fBinput\-label \fRBorder label of the input window (\fB\-\-input\-label\fR)
302 \fBheader\-label \fRBorder label of the header window (\fB\-\-header\-label\fR)
303 \fBfooter\-label \fRBorder label of the footer window (\fB\-\-footer\-label\fR)
304 \fBprompt \fRPrompt
305 \fBpointer \fRPointer to the current line
306 \fBmarker \fRMulti\-select marker
307 \fBspinner \fRStreaming input indicator
308 \fBheader (header\-fg) \fRHeader
309 \fBfooter (footer\-fg) \fRFooter
310 \fBnth \fRParts of the line specified by \fB\-\-nth\fR (only supports attributes)
311 \fBnomatch \fRNon-matching items in raw mode (default: \fBdim\fR)
312
313 .B ANSI COLORS:
314 \fB\-1 \fRDefault terminal foreground/background color
315 \fB \fR(or the original color of the text)
316 \fB0 ~ 15 \fR16 base colors
317 \fBblack\fR
318 \fBred\fR
319 \fBgreen\fR
320 \fByellow\fR
321 \fBblue\fR
322 \fBmagenta\fR
323 \fBcyan\fR
324 \fBwhite\fR
325 \fBbright\-black\fR (gray | grey)
326 \fBbright\-red\fR
327 \fBbright\-green\fR
328 \fBbright\-yellow\fR
329 \fBbright\-blue\fR
330 \fBbright\-magenta\fR
331 \fBbright\-cyan\fR
332 \fBbright\-white\fR
333 \fB16 ~ 255 \fRANSI 256 colors
334 \fB#rrggbb \fR24-bit colors
335
336 .B ANSI ATTRIBUTES: (Only applies to foreground colors)
337 \fBregular \fRClear previously set attributes; should precede the other ones
338 \fBstrip \fRRemove colors
339 \fBbold\fR
340 \fBunderline\fR
341 \fBunderline-double\fR
342 \fBunderline-curly\fR
343 \fBunderline-dotted\fR
344 \fBunderline-dashed\fR
345 \fBreverse\fR
346 \fBdim\fR
347 \fBitalic\fR
348 \fBstrikethrough\fR
349
350 .B EXAMPLES:
351
352 \fB# Seoul256 theme with 8-bit colors
353 # (https://github.com/junegunn/seoul256.vim)
354 fzf \-\-color='bg:237,bg+:236,info:143,border:240,spinner:108' \\
355 \-\-color='hl:65,fg:252,header:65,fg+:252' \\
356 \-\-color='pointer:161,marker:168,prompt:110,hl+:108'
357
358 # Seoul256 theme with 24-bit colors
359 fzf \-\-color='bg:#4B4B4B,bg+:#3F3F3F,info:#BDBB72,border:#6B6B6B,spinner:#98BC99' \\
360 \-\-color='hl:#719872,fg:#D9D9D9,header:#719872,fg+:#D9D9D9' \\
361 \-\-color='pointer:#E12672,marker:#E17899,prompt:#98BEDE,hl+:#98BC99'
362
363 # Seoul256 light theme with 24-bit colors, each entry separated by whitespaces
364 fzf \-\-style full \-\-color='
365 fg:#616161 fg+:#616161
366 bg:#ffffff bg+:#e9e9e9 alt-bg:#f1f1f1
367 hl:#719872 hl+:#719899
368 pointer:#e12672 marker:#e17899
369 header:#719872
370 spinner:#719899 info:#727100
371 prompt:#0099bd query:#616161
372 border:#e1e1e1
373 '\fR
374 .RE
375 .TP
376 .B "\-\-no\-color"
377 Disable colors
378 .TP
379 .B "\-\-no\-bold"
380 Do not use bold text
381 .TP
382 .B "\-\-black"
383 Use black background
384
385 .SS DISPLAY MODE
386 .TP
387 .BI "\-\-height=" "[~][\-]HEIGHT[%]"
388 Display fzf window below the cursor with the given height instead of using
389 the full screen.
390
391 If a negative value is specified, the height is calculated as the terminal
392 height minus the given value.
393
394 fzf \-\-height=\-1
395
396 When prefixed with \fB~\fR, fzf will automatically determine the height in the
397 range according to the input size. You can combine \fB~\fR with a negative
398 value.
399
400 # Will not take up 100% of the screen
401 seq 5 | fzf \-\-height=~100%
402
403 # Adapt to input size, up to terminal height minus 1
404 seq 5 | fzf \-\-height=~\-1
405
406 Adaptive height has the following limitations:
407 .br
408 * Cannot be used with top/bottom margin and padding given in percent size
409 .br
410 * It will not find the right size when there are multi-line items
411 .br
412 * fzf cannot start until the input ends or exceeds the height, so a stream
413 that stays below it will delay the first render
414
415 .TP
416 .BI "\-\-min\-height=" "HEIGHT[+]"
417 Minimum height when \fB\-\-height\fR is given as a percentage.
418 Add \fB+\fR to automatically increase the value according to the other
419 layout options so that the specified number of items are visible in the list
420 section (default: \fB10+\fR).
421 Ignored when \fB\-\-height\fR is not specified or set as an absolute value.
422 .TP
423 .BI "\-\-popup" "[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]][,border-native]]"
424 Start fzf in a tmux or Zellij floating pane (default \fBcenter,50%\fR).
425 Requires tmux 3.3+ or Zellij 0.44+. This option is ignored if you
426 are not running fzf inside tmux or Zellij. \fB\-\-tmux\fR is an alias for this option.
427
428 On tmux 3.7 or above and on Zellij, the floating pane is not modal; you can
429 switch to other panes and windows while fzf is running, and move and resize
430 the pane with the mouse. The native border of the pane is the handle for
431 moving and resizing it, so it is used by default and \fBborder\-native\fR is
432 implied. \fB\-\-border\-label\fR is displayed on the native border, and
433 \fBchange\-border\-label\fR and \fBtransform\-border\-label\fR update it
434 (\fB\-\-border\-label\-pos\fR is ignored). On tmux, fzf holds the label in
435 the \fB@fzf\-border\-label\fR option of the pane and sets its
436 \fBpane\-border\-format\fR to read it back, so the label is displayed if
437 \fBpane\-border\-status\fR is enabled in tmux. The title of the pane is left
438 alone. On Zellij, the label is the name of the pane.
439
440 fzf draws its own border instead when a border style is explicitly specified
441 with \fB\-\-border\fR, so that it is the only border shown. \fBnone\fR and
442 \fBline\fR are treated as no border. Give \fBborder\-native\fR to keep the
443 native border nonetheless. On tmux, the fzf\-drawn border is shown in a modal
444 popup, since the native border of a tmux floating pane cannot be removed;
445 this is also the case on tmux versions below 3.7.
446
447 e.g.
448 \fB# Popup in the center with 70% width and height
449 fzf \-\-popup 70%
450
451 # Popup on the left with 40% width and 100% height
452 fzf \-\-popup right,40%
453
454 # Popup on the bottom with 100% width and 30% height
455 fzf \-\-popup bottom,30%
456
457 # Popup on the top with 80% width and 40% height
458 fzf \-\-popup top,80%,40%
459
460 # Popup with a native tmux or Zellij border in the center with 80% width and height
461 fzf \-\-popup center,80%,border\-native\fR
462
463 .SS LAYOUT
464 .TP
465 .BI "\-\-layout=" "LAYOUT"
466 Choose the layout (default: default)
467
468 .br
469 .BR default " Display from the bottom of the screen"
470 .br
471 .BR reverse " Display from the top of the screen"
472 .br
473 .BR reverse\-list " Display from the top of the screen, prompt at the bottom"
474 .br
475
476 .TP
477 .B "\-\-reverse"
478 A synonym for \fB\-\-layout=reverse\fB
479
480 .TP
481 .BI "\-\-margin=" MARGIN
482 Comma-separated expression for margins around the finder.
483 .br
484
485 .br
486 .RS
487 .BR TRBL " Same margin for top, right, bottom, and left"
488 .br
489 .BR TB,RL " Vertical, horizontal margin"
490 .br
491 .BR T,RL,B " Top, horizontal, bottom margin"
492 .br
493 .BR T,R,B,L " Top, right, bottom, left margin"
494 .br
495
496 .br
497 Each part can be given in absolute number or in percentage relative to the
498 terminal size with \fB%\fR suffix.
499 .br
500
501 .br
502 e.g.
503 \fBfzf \-\-margin 10%
504 fzf \-\-margin 1,5%\fR
505 .RE
506 .TP
507 .BI "\-\-padding=" PADDING
508 Comma-separated expression for padding inside the border. Padding is
509 distinguishable from margin only when \fB\-\-border\fR option is used.
510 .br
511
512 .br
513 e.g.
514 \fBfzf \-\-margin 5% \-\-padding 5% \-\-border \-\-preview 'cat {}' \\
515 \-\-color bg:#222222,preview\-bg:#333333\fR
516
517 .br
518 .RS
519 .BR TRBL " Same padding for top, right, bottom, and left"
520 .br
521 .BR TB,RL " Vertical, horizontal padding"
522 .br
523 .BR T,RL,B " Top, horizontal, bottom padding"
524 .br
525 .BR T,R,B,L " Top, right, bottom, left padding"
526 .br
527 .RE
528
529 .TP
530 .BI "\-\-border" [=STYLE]
531 Draw border around the finder
532
533 .br
534 .BR rounded " Border with rounded corners (default)"
535 .br
536 .BR sharp " Border with sharp corners"
537 .br
538 .BR bold " Border with bold lines"
539 .br
540 .BR double " Border with double lines"
541 .br
542 .BR dashed " Border with dashed lines and rounded corners"
543 .br
544 .BR block " Border using block elements; suitable when using different background colors"
545 .br
546 .BR thinblock " Border using legacy computing symbols; may not be displayed on some terminals"
547 .br
548 .BR horizontal " Horizontal lines above and below the finder"
549 .br
550 .BR vertical " Vertical lines on each side of the finder"
551 .br
552 .BR line " Single line border (position automatically determined)"
553 .br
554 .BR top " (up)"
555 .br
556 .BR bottom " (down)"
557 .br
558 .BR left
559 .br
560 .BR right
561 .br
562 .BR none
563 .br
564
565 If you use a terminal emulator where each box-drawing character takes
566 2 columns, try setting \fB\-\-ambidouble\fR. If the border is still not properly
567 rendered, set \fB\-\-no\-unicode\fR.
568
569 \fBline\fR style draws a single separator line at the top when \fB\-\-height\fR
570 is used.
571
572 .TP
573 .BI "\-\-border\-label" [=LABEL]
574 Label to print on the horizontal border line. Should be used with one of the
575 following \fB\-\-border\fR options.
576
577 .br
578 .B * rounded
579 .br
580 .B * sharp
581 .br
582 .B * bold
583 .br
584 .B * double
585 .br
586 .B * horizontal
587 .br
588 .BR "* top" " (up)"
589 .br
590 .BR "* bottom" " (down)"
591 .br
592
593 .br
594 e.g.
595 \fB# ANSI color codes are supported
596 # (with https://github.com/busyloop/lolcat)
597 label=$(curl \-s http://metaphorpsum.com/sentences/1 | lolcat \-f)
598
599 # Border label at the center
600 fzf \-\-height=10 \-\-border \-\-border\-label="╢ $label ╟" \-\-color=label:italic:black
601
602 # Left-aligned (positive integer)
603 fzf \-\-height=10 \-\-border \-\-border\-label="╢ $label ╟" \-\-border\-label\-pos=3 \-\-color=label:italic:black
604
605 # Right-aligned (negative integer) on the bottom line (:bottom)
606 fzf \-\-height=10 \-\-border \-\-border\-label="╢ $label ╟" \-\-border\-label\-pos=\-3:bottom \-\-color=label:italic:black\fR
607
608 .TP
609 .BI "\-\-border\-label\-pos" [=N[:top|bottom]]
610 Position of the border label on the border line. Specify a positive integer as
611 the column position from the left. Specify a negative integer to right-align
612 the label. Label is printed on the top border line by default, add
613 \fB:bottom\fR to put it on the border line on the bottom. The default value
614 \fB0 (or \fBcenter\fR) will put the label at the center of the border line.
615
616 .SS LIST SECTION
617 .TP
618 .BI "\-m, \-\-multi" "[=MAX]"
619 Enable multi-select with tab/shift\-tab. It optionally takes an integer argument
620 which denotes the maximum number of items that can be selected.
621 .TP
622 .B "+m, \-\-no\-multi"
623 Disable multi-select
624 .TP
625 .B "\-\-highlight\-line"
626 Highlight the whole current line
627 .TP
628 .B "\-\-cycle"
629 Enable cyclic scroll
630 .TP
631 .BI "\-\-wrap" "[=MODE]"
632 Enable line wrap. \fIMODE\fR can be \fBchar\fR (default) or \fBword\fR.
633 \fBword\fR mode wraps lines at word boundaries (spaces and tabs) instead of
634 at arbitrary character positions. \fB\-\-wrap\-word\fR is a synonym for
635 \fB\-\-wrap=word\fR.
636 .TP
637 .BI "\-\-wrap\-sign" "=INDICATOR"
638 Indicator for wrapped lines. The default is '↳ ' or '> ' depending on
639 \fB\-\-no\-unicode\fR.
640 .TP
641 .B "\-\-no\-multi\-line"
642 Disable multi-line display of items when using \fB\-\-read0\fR
643 .TP
644 .B "\-\-raw"
645 Enable raw mode where non-matching items are also displayed in a dimmed color.
646 .TP
647 .BI "\-\-track"
648 Make fzf track the current selection when the result list is updated.
649 This can be useful when browsing logs using fzf with sorting disabled. It is
650 not recommended to use this option with \fB\-\-tac\fR as the resulting behavior
651 can be confusing.
652
653 When \fB\-\-id\-nth\fR is also set, fzf enables field\-based tracking across
654 \fBreload\fRs. See \fB\-\-id\-nth\fR for details.
655
656 Without \fB\-\-id\-nth\fR, \fB\-\-track\fR uses index\-based tracking that
657 does not persist across reloads.
658
659 .RS
660 e.g.
661 \fB# Index\-based tracking (does not persist across reloads)
662 git log \-\-oneline \-\-graph \-\-color=always | nl |
663 fzf \-\-ansi \-\-track \-\-no\-sort \-\-layout=reverse\-list\fR
664
665 \fB# Track by first field (e.g. pod name) across reloads
666 kubectl get pods | fzf \-\-track \-\-id\-nth 1 \-\-header\-lines=1 \\
667 \-\-bind 'ctrl\-r:reload:kubectl get pods'\fR
668 .RE
669 .TP
670 .BI "\-\-id\-nth=" "N[,..]"
671 Define item identity fields for cross\-reload operations. When set, fzf
672 uses the specified fields to identify items across \fBreload\fR and
673 \fBreload\-sync\fR.
674
675 With \fB\-\-track\fR, fzf extracts the tracking key from the current item
676 using the nth expression and searches for a matching item in the reloaded list.
677 While searching, the UI is blocked (query input and cursor movement are
678 disabled, and the prompt is dimmed). With \fBreload\fR, the blocked state
679 clears as soon as the match is found in the stream. With \fBreload\-sync\fR,
680 the blocked state persists until the entire stream is complete. Press
681 \fBEscape\fR or \fBCtrl\-C\fR to cancel the blocked state without quitting fzf.
682
683 The info line shows \fB+T*\fR (or \fB+t*\fR for one\-off tracking) while
684 the search is in progress.
685
686 With \fB\-\-multi\fR, selected items are preserved across \fBreload\-sync\fR
687 by matching their identity fields in the reloaded list.
688
689 .RS
690 e.g.
691 \fB# Track and preserve selections by pod name across reloads
692 kubectl get pods | fzf \-\-multi \-\-track \-\-id\-nth 1 \-\-header\-lines=1 \\
693 \-\-bind 'ctrl\-r:reload\-sync:kubectl get pods'\fR
694 .RE
695 .TP
696 .B "\-\-tac"
697 Reverse the order of the input
698
699 .RS
700 e.g.
701 \fBhistory | fzf \-\-tac \-\-no\-sort\fR
702 .RE
703 .TP
704 .BI "\-\-gap" "[=N]"
705 Render empty lines between each item
706 .TP
707 .BI "\-\-gap\-line" "[=STR]"
708 The given string will be repeated to draw a horizontal line on each gap
709 (default: '┈' or '\-' depending on \fB\-\-no\-unicode\fR).
710 .TP
711 .BI "\-\-freeze\-left=" "N"
712 Number of fields to freeze on the left.
713 .TP
714 .BI "\-\-freeze\-right=" "N"
715 Number of fields to freeze on the right.
716 .TP
717 .B "\-\-keep\-right"
718 Keep the right end of the line visible when it's too long. Effective only when
719 the query string is empty. Use \fB\-\-freeze\-right=1\fR instead if you want
720 the last field to be always visible even with a non-empty query.
721 .TP
722 .BI "\-\-scroll\-off=" "LINES"
723 Number of screen lines to keep above or below when scrolling to the top or to
724 the bottom (default: 3).
725 .TP
726 .B "\-\-no\-hscroll"
727 Disable horizontal scroll
728 .TP
729 .BI "\-\-hscroll\-off=" "COLS"
730 Number of screen columns to keep to the right of the highlighted substring
731 (default: 10). Setting it to a large value will cause the text to be positioned
732 on the center of the screen.
733 .TP
734 .BI "\-\-jump\-labels=" "CHARS"
735 Label characters for \fBjump\fR mode.
736 .TP
737 .BI "\-\-gutter=" "CHAR"
738 Character used for the gutter column (default: '▌' unless \fB\-\-no\-unicode\fR is given)
739 .TP
740 .BI "\-\-gutter\-raw=" "CHAR"
741 Character used for the gutter column in raw mode (default: 'â––' unless \fB\-\-no\-unicode\fR is given)
742 .TP
743 .BI "\-\-pointer=" "STR"
744 Pointer to the current line (default: '▌' or '>' depending on \fB\-\-no\-unicode\fR)
745 .TP
746 .BI "\-\-marker=" "STR"
747 Multi-select marker (default: '┃' or '>' depending on \fB\-\-no\-unicode\fR)
748 .TP
749 .BI "\-\-marker\-multi\-line=" "STR"
750 Multi-select marker for multi-line entries. 3 elements for top, middle, and bottom.
751 (default: '╻┃╹' or '.|'' depending on \fB\-\-no\-unicode\fR)
752 .TP
753 .BI "\-\-ellipsis=" "STR"
754 Ellipsis to show when line is truncated (default: '··')
755 .TP
756 .BI "\-\-tabstop=" SPACES
757 Number of spaces for a tab character (default: 8)
758 .TP
759 .BI "\-\-scrollbar=" "CHAR1[CHAR2]"
760 Use the given character to render scrollbar. (default: '│' or ':' depending on
761 \fB\-\-no\-unicode\fR). The optional \fBCHAR2\fR is used to render scrollbar of
762 the preview window.
763
764 .TP
765 .B "\-\-no\-scrollbar"
766 Do not display scrollbar. A synonym for \fB\-\-scrollbar=''\fB
767
768 .TP
769 .BI "\-\-list\-border" [=STYLE]
770 Draw border around the list section. \fBline\fR style is not supported for
771 this border.
772
773 .TP
774 .BI "\-\-list\-label" [=LABEL]
775 Label to print on the list border
776
777 .TP
778 .BI "\-\-list\-label\-pos" [=N[:top|bottom]]
779 Position of the list label
780
781 .SS INPUT SECTION
782
783 .TP
784 .B "\-\-no\-input"
785 Disable and hide the input section. You can no longer type in queries. To
786 trigger a search, use \fBsearch\fR action. You can later show the input section
787 using \fBshow\-input\fR or \fBtoggle\-input\fR action, and hide it again using
788 \fBhide\-input\fR, or \fBtoggle\-input\fR.
789
790 .TP
791 .BI "\-\-prompt=" "STR"
792 Input prompt (default: '> ')
793 .TP
794 .BI "\-\-info=" "STYLE"
795 Determines the display style of the finder info. (e.g. match counter, loading indicator, etc.)
796
797 .BR default " On the left end of the horizontal separator"
798 .br
799 .BR right " On the right end of the horizontal separator"
800 .br
801 .BR hidden " Do not display finder info"
802 .br
803 .BR inline " After the prompt with the default prefix ' < '"
804 .br
805 .BR inline:PREFIX " After the prompt with a non-default prefix"
806 .br
807 .BR inline\-right " On the right end of the prompt line"
808 .br
809 .BR inline\-right:PREFIX " On the right end of the prompt line with a custom prefix"
810 .br
811
812 .TP
813 .BI "\-\-info\-command=" "COMMAND"
814 Command to generate the finder info line. The command runs synchronously and
815 blocks the UI until completion, so make sure that it's fast. ANSI color codes
816 are supported. \fB$FZF_INFO\fR variable is set to the original info text.
817 For additional environment variables available to the command, see the section
818 ENVIRONMENT VARIABLES EXPORTED TO CHILD PROCESSES.
819
820 e.g.
821 \fB# Prepend the current cursor position in yellow
822 fzf \-\-info\-command='printf "\\x1b[33;1m$FZF_POS\\x1b[m/$FZF_INFO 💛"'\fR
823
824 .TP
825 .B "\-\-no\-info"
826 A synonym for \fB\-\-info=hidden\fB
827
828 .TP
829 .BI "\-\-separator=" "STR"
830 The given string will be repeated to form the horizontal separator on the info
831 line (default: '─' or '\-' depending on \fB\-\-no\-unicode\fR).
832
833 Unless explicitly specified, the separator is not displayed if the input
834 section is already visually separated from the list section by a border line
835 (e.g. \fB\-\-input\-border\fR or \fB\-\-header\-border\fR).
836
837 ANSI color codes are supported.
838
839 .TP
840 .B "\-\-no\-separator"
841 Do not display horizontal separator on the info line. A synonym for
842 \fB\-\-separator=''\fB
843
844 .TP
845 .BI "\-\-ghost=" "TEXT"
846 Ghost text to display when the input is empty
847
848 .TP
849 .B "\-\-filepath\-word"
850 Make word-wise movements and actions respect path separators. The following
851 actions are affected:
852
853 \fBbackward\-kill\-word\fR
854 .br
855 \fBbackward\-word\fR
856 .br
857 \fBforward\-word\fR
858 .br
859 \fBkill\-word\fR
860 .TP
861 .BI "\-\-input\-border" [=STYLE]
862 Draw border around the input section. \fBline\fR style draws a single separator
863 line between the input section and the list section.
864
865 .TP
866 .BI "\-\-input\-label" [=LABEL]
867 Label to print on the input border
868
869 .TP
870 .BI "\-\-input\-label\-pos" [=N[:top|bottom]]
871 Position of the input label
872
873 .SS PREVIEW WINDOW
874 .TP
875 .BI "\-\-preview=" "COMMAND"
876 Execute the given command for the current line and display the result on the
877 preview window. \fB{}\fR in the command is the placeholder that is replaced to
878 the single-quoted string of the current line. To transform the replacement
879 string, specify field index expressions between the braces (See \fBFIELD INDEX
880 EXPRESSION\fR for the details).
881
882 .RS
883 e.g.
884 \fBfzf \-\-preview='head \-$LINES {}'
885 ls \-l | fzf \-\-preview="echo user={3} when={\-4..\-2}; cat {\-1}" \-\-header\-lines=1\fR
886
887 fzf exports \fB$FZF_PREVIEW_LINES\fR and \fB$FZF_PREVIEW_COLUMNS\fR so that
888 they represent the exact size of the preview window. (It also overrides
889 \fB$LINES\fR and \fB$COLUMNS\fR with the same values but they can be reset
890 by the default shell, so prefer to refer to the ones with \fBFZF_PREVIEW_\fR
891 prefix.)
892
893 fzf also exports \fB$FZF_PREVIEW_TOP\fR and \fB$FZF_PREVIEW_LEFT\fR so that
894 the preview command can determine the position of the preview window.
895
896 A placeholder expression starting with \fB+\fR flag will be replaced to the
897 space-separated list of the selected items (or the current item if no selection
898 was made) individually quoted.
899
900 e.g.
901 \fBfzf \-\-multi \-\-preview='head \-10 {+}'
902 git log \-\-oneline | fzf \-\-multi \-\-preview 'git show {+1}'\fR
903
904 Similarly, a placeholder expression starting with \fB*\fR flag will be replaced
905 to the space-separated list of all matched items individually quoted.
906
907 Each expression expands to a quoted string, so that it's safe to pass it as an
908 argument to an external command. So you should not manually add quotes around
909 the curly braces. But if you don't want this behavior, you can put
910 \fBr\fR flag (raw) in the expression (e.g. \fB{r}\fR, \fB{r1}\fR, etc).
911 Use it with caution as unquoted output can lead to broken commands.
912
913 When using a field index expression, leading and trailing whitespace is stripped
914 from the replacement string. To preserve the whitespace, use the \fBs\fR flag.
915
916 A placeholder expression with \fBf\fR flag is replaced to the path of
917 a temporary file that holds the evaluated list. This is useful when you
918 pass a large number of items and the length of the evaluated string may
919 exceed \fBARG_MAX\fR.
920
921 e.g.
922 \fB# See the sum of all the matched numbers
923 # This won't work properly without 'f' flag due to ARG_MAX limit.
924 seq 100000 | fzf \-\-preview "awk '{sum+=\\$1} END {print sum}' {*f}"\fR
925
926 \fB# Use {+f} to get the selected items as a line-separated list
927 seq 100 | fzf \-\-multi \-\-bind 'enter:become:cat {+f}'\fR
928
929 Also,
930
931 * \fB{q}\fR is replaced to the current query string
932 .br
933 * \fB{q}\fR can contain field index expressions. e.g. \fB{q:1}\fR, \fB{q:2..}\fR, etc.
934 .br
935 * \fB{n}\fR is replaced to the zero-based ordinal index of the current item.
936 Use \fB{+n}\fR if you want all index numbers when multiple lines are selected.
937 .br
938
939 Note that you can escape a placeholder pattern by prepending a backslash.
940
941 Preview window will be updated even when there is no match for the current
942 query if any of the placeholder expressions evaluates to a non-empty string
943 or \fB{q}\fR is in the command template.
944
945 Since 0.24.0, fzf can render partial preview content before the preview command
946 completes. ANSI escape sequence for clearing the display (\fBCSI 2 J\fR) is
947 supported, so you can use it to implement preview window that is constantly
948 updating.
949
950 e.g.
951 \fBfzf \-\-preview 'for i in $(seq 100000); do
952 (( i % 200 == 0 )) && printf "\\033[2J"
953 echo "$i"
954 sleep 0.01
955 done'\fR
956
957 fzf has experimental support for Kitty graphics protocol and Sixel graphics.
958 The following example uses https://github.com/junegunn/fzf/blob/master/bin/fzf\-preview.sh
959 script to render an image using either of the protocols inside the preview window.
960
961 e.g.
962 \fBfzf \-\-preview='fzf\-preview.sh {}'\fR
963
964 .RE
965
966 .TP
967 .BI "\-\-preview\-border" [=STYLE]
968 Short for \fB\-\-preview\-window=border\-STYLE\fR. \fBline\fR style draws
969 a single separator line between the preview window and the rest of the
970 interface.
971
972 .TP
973 .BI "\-\-preview\-label" [=LABEL]
974 Label to print on the horizontal border line of the preview window.
975 Should be used with one of the following \fB\-\-preview\-window\fR options.
976
977 .br
978 .B * border\-rounded (default on non-Windows platforms)
979 .br
980 .B * border\-sharp (default on Windows)
981 .br
982 .B * border\-bold
983 .br
984 .B * border\-double
985 .br
986 .B * border\-dashed
987 .br
988 .B * border\-block
989 .br
990 .B * border\-thinblock
991 .br
992 .B * border\-horizontal
993 .br
994 .B * border\-top
995 .br
996 .B * border\-bottom
997 .br
998
999 .TP
1000 .BI "\-\-preview\-wrap\-sign" =INDICATOR
1001 Indicator for wrapped lines in the preview window. If not set, the value of
1002 \fB\-\-wrap\-sign\fR is used.
1003
1004 .TP
1005 .BI "\-\-preview\-label\-pos" [=N[:top|bottom]]
1006 Position of the border label on the border line of the preview window. Specify
1007 a positive integer as the column position from the left. Specify a negative
1008 integer to right-align the label. Label is printed on the top border line by
1009 default, add \fB:bottom\fR to put it on the border line on the bottom. The
1010 default value 0 (or \fBcenter\fR) will put the label at the center of the
1011 border line.
1012
1013 .TP
1014 .BI "\-\-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)]"
1015
1016 .RS
1017 .B POSITION: (default: right)
1018 \fBup
1019 \fBdown
1020 \fBleft
1021 \fBright
1022 \fBnext
1023
1024 \fRDetermines the layout of the preview window.
1025
1026 * \fBnext\fR places the preview window adjacent to the input section, on
1027 the list side: above the input in the default layout, below the input
1028 in \fB\-\-layout=reverse\fR.
1029
1030 * If the argument contains \fB:hidden\fR, the preview window will be hidden by
1031 default until \fBtoggle\-preview\fR action is triggered.
1032
1033 * If size is given as 0, preview window will not be visible, but fzf will still
1034 execute the command in the background.
1035
1036 * Long lines are truncated by default. Line wrap can be enabled with
1037 \fBwrap\fR flag. \fBwrap\-word\fR flag enables word-level wrapping, which
1038 breaks lines at word boundaries instead of mid-word.
1039
1040 * Preview window will automatically scroll to the bottom when \fBfollow\fR
1041 flag is set, similarly to how \fBtail \-f\fR works.
1042
1043 .RS
1044 e.g.
1045 \fBfzf \-\-preview\-window follow \-\-preview 'for i in $(seq 100000); do
1046 echo "$i"
1047 sleep 0.01
1048 (( i % 300 == 0 )) && printf "\\033[2J"
1049 done'\fR
1050 .RE
1051
1052 * Cyclic scrolling is enabled with \fBcycle\fR flag.
1053
1054 * To hide the scroll offset information on the top right corner, specify
1055 \fBnoinfo\fR.
1056
1057 * To change the style of the border of the preview window, specify one of
1058 the options for \fB\-\-border\fR with \fBborder\-\fR prefix.
1059 e.g. \fBborder\-rounded\fR (border with rounded edges, default),
1060 \fBborder\-sharp\fR (border with sharp edges), \fBborder\-left\fR,
1061 \fBborder\-none\fR, etc.
1062
1063 * In addition to the other border styles, \fBborder\-line\fR style is also
1064 supported, which draws a single separator line between the preview window and
1065 the rest of the interface.
1066
1067 * \fB[:+SCROLL[OFFSETS][/DENOM]]\fR determines the initial scroll offset of the
1068 preview window.
1069
1070 - \fBSCROLL\fR can be either a numeric integer or a single-field index expression that refers to a numeric integer or {n} to refer to the zero-based ordinal index of the current item.
1071
1072 - The optional \fBOFFSETS\fR part is for adjusting the base offset. It should be given as a series of signed integers (\fB\-INTEGER\fR or \fB+INTEGER\fR).
1073
1074 - The final \fB/DENOM\fR part is for specifying a fraction of the preview window height.
1075
1076 * \fB~HEADER_LINES\fR keeps the top N lines as the fixed header so that they
1077 are always visible.
1078
1079 * \fBdefault\fR resets all options previously set to the default.
1080
1081 .RS
1082 e.g.
1083 \fB# Non-default scroll window positions and sizes
1084 fzf \-\-preview="head {}" \-\-preview\-window=up,30%
1085 fzf \-\-preview="file {}" \-\-preview\-window=down,1
1086
1087 # Initial scroll offset is set to the line number of each line of
1088 # git grep output *minus* 5 lines (\-5)
1089 git grep \-\-line\-number '' |
1090 fzf \-\-delimiter : \-\-preview 'nl {1}' \-\-preview\-window '+{2}\-5'
1091
1092 # Preview with bat, matching line in the middle of the window below
1093 # the fixed header of the top 3 lines
1094 #
1095 # ~3 Top 3 lines as the fixed header
1096 # +{2} Base scroll offset extracted from the second field
1097 # +3 Extra offset to compensate for the 3-line header
1098 # /2 Put in the middle of the preview area
1099 #
1100 git grep \-\-line\-number '' |
1101 fzf \-\-delimiter : \\
1102 \-\-preview 'bat \-\-style=full \-\-color=always \-\-highlight\-line {2} {1}' \\
1103 \-\-preview\-window '~3,+{2}+3/2'
1104
1105 # Display top 3 lines as the fixed header
1106 fzf \-\-preview 'bat \-\-style=full \-\-color=always {}' \-\-preview\-window '~3'\fR
1107 .RE
1108
1109 * You can specify an alternative set of options that are used only when the size
1110 of the preview window is below a certain threshold. Note that only one
1111 alternative layout is allowed.
1112
1113 .RS
1114 e.g.
1115 \fBfzf \-\-preview 'cat {}' \-\-preview\-window 'right,border\-left,<30(up,30%,border\-bottom)'\fR
1116 .RE
1117
1118 .SS HEADER
1119
1120 .TP
1121 .BI "\-\-header=" "STR"
1122 The given string will be printed as the sticky header. The lines are displayed
1123 in the given order from top to bottom regardless of \fB\-\-layout\fR option, and
1124 are not affected by \fB\-\-with\-nth\fR. ANSI color codes are processed even when
1125 \fB\-\-ansi\fR is not set.
1126 .TP
1127 .BI "\-\-header\-lines=" "N"
1128 The first N lines of the input are treated as the sticky header. When
1129 \fB\-\-with\-nth\fR is set, the lines are transformed just like the other
1130 lines that follow.
1131 .TP
1132 .B "\-\-header\-first"
1133 Print header before the prompt line. When both normal header and header lines
1134 (\fB\-\-header\-lines\fR) are present, this applies only to the normal header.
1135 .TP
1136 .BI "\-\-header\-border" [=STYLE]
1137 Draw border around the header section. \fBline\fR style draws a single
1138 separator line between the header window and the list section. \fBinline\fR
1139 style embeds the header inside the list border frame, joined to the list
1140 section by a horizontal separator; it requires a \fB\-\-list\-border\fR
1141 shape that has both top and bottom segments (rounded / sharp / bold /
1142 double / dashed / block / thinblock / horizontal) and falls back to \fBline\fR
1143 otherwise. When the list border also has side segments, the separator
1144 joins them with T-junctions; \fBhorizontal\fR has no side borders, so the
1145 separator is drawn without T-junction endpoints. Takes precedence over
1146 \fB\-\-header\-first\fR (the section stays inside the list frame), and
1147 when \fB\-\-header\-lines\fR is also set \fB\-\-header\-lines\-border\fR
1148 must also be \fBinline\fR.
1149
1150 .TP
1151 .BI "\-\-header\-label" [=LABEL]
1152 Label to print on the header border
1153
1154 .TP
1155 .BI "\-\-header\-label\-pos" [=N[:top|bottom]]
1156 Position of the header label
1157
1158 .TP
1159 .BI "\-\-header\-lines\-border" [=STYLE]
1160 Display header from \fB--header\-lines\fR with a separate border. Pass
1161 \fBnone\fR to still separate the header lines but without a border. To combine
1162 two headers, use \fB\-\-no\-header\-lines\-border\fR. \fBline\fR style draws
1163 a single separator line between the header lines and the list section.
1164 \fBinline\fR style embeds the header lines inside the list border frame
1165 with a horizontal separator; it requires a \fB\-\-list\-border\fR shape
1166 that has both top and bottom segments, falls back to \fBline\fR
1167 otherwise.
1168
1169 .SS FOOTER
1170
1171 .TP
1172 .BI "\-\-footer=" "STR"
1173 The given string will be printed as the sticky footer. The lines are displayed
1174 in the given order from top to bottom regardless of \fB\-\-layout\fR option, and
1175 are not affected by \fB\-\-with\-nth\fR. ANSI color codes are processed even when
1176 \fB\-\-ansi\fR is not set.
1177
1178 .TP
1179 .BI "\-\-footer\-border" [=STYLE]
1180 Draw border around the footer section. \fBline\fR style draws a single
1181 separator line between the footer and the list section. \fBinline\fR style
1182 embeds the footer inside the list border frame with a horizontal separator;
1183 it requires a \fB\-\-list\-border\fR shape that has both top and bottom
1184 segments and falls back to \fBline\fR otherwise.
1185
1186 .TP
1187 .BI "\-\-footer\-label" [=LABEL]
1188 Label to print on the footer border
1189
1190 .TP
1191 .BI "\-\-footer\-label\-pos" [=N[:top|bottom]]
1192 Position of the footer label
1193
1194 .SS SCRIPTING
1195 .TP
1196 .BI "\-q, \-\-query=" "STR"
1197 Start the finder with the given query
1198 .TP
1199 .B "\-1, \-\-select\-1"
1200 If there is only one match for the initial query (\fB\-\-query\fR), do not start
1201 interactive finder and automatically select the only match
1202 .TP
1203 .B "\-0, \-\-exit\-0"
1204 If there is no match for the initial query (\fB\-\-query\fR), do not start
1205 interactive finder and exit immediately
1206 .TP
1207 .BI "\-f, \-\-filter=" "STR"
1208 Filter mode. Do not start interactive finder. When used with \fB\-\-no\-sort\fR,
1209 fzf becomes a fuzzy-version of grep.
1210 .TP
1211 .B "\-\-print\-query"
1212 Print query as the first line
1213 .TP
1214 .BI "\-\-expect=" "KEY[,..]"
1215 Comma-separated list of keys that can be used to complete fzf in addition to
1216 the default enter key. When this option is set, fzf will print the name of the
1217 key pressed as the first line of its output (or as the second line if
1218 \fB\-\-print\-query\fR is also used). The line will be empty if fzf is completed
1219 with the default enter key. If \fB\-\-expect\fR option is specified multiple
1220 times, fzf will expect the union of the keys. \fB\-\-no\-expect\fR will clear the
1221 list.
1222
1223 e.g.
1224 \fBfzf \-\-expect=ctrl\-v,ctrl\-t,alt\-s \-\-expect=f1,f2,~,@\fR
1225
1226 This option is not compatible with \fB\-\-bind\fR on the same key and will take
1227 precedence over it. To combine the two, use \fBprint\fR action.
1228
1229 e.g.
1230 \fBfzf \-\-multi \\
1231 \-\-bind 'enter:print()+accept,ctrl\-y:select\-all+print(ctrl\-y)+accept'\fR
1232 .TP
1233 .B "\-\-no\-clear"
1234 Do not clear finder interface on exit. If fzf was started in full screen mode,
1235 it will not switch back to the original screen, so you'll have to manually run
1236 \fBtput rmcup\fR to return. This option can be used to avoid flickering of the
1237 screen when your application needs to start fzf multiple times in order. (Note
1238 that in most cases, it is preferable to use \fBreload\fR action instead.)
1239
1240 e.g.
1241 \fBfoo=$(seq 100 | fzf \-\-no\-clear) || (
1242 # Need to manually switch back to the main screen when cancelled
1243 tput rmcup
1244 exit 1
1245 ) && seq "$foo" 100 | fzf
1246
1247 .SS KEY/EVENT BINDING
1248 .TP
1249 .BI "\-\-bind=" "BINDINGS"
1250 Comma-separated list of custom key/event bindings. See \fBKEY/EVENT BINDINGS\fR
1251 for the details.
1252
1253 .SS ADVANCED
1254 .TP
1255 .B "\-\-with\-shell=STR"
1256 Shell command and flags to start child processes with. On *nix Systems, the
1257 default value is \fB$SHELL \-c\fR if \fB$SHELL\fR is set, otherwise \fBsh \-c\fR.
1258 On Windows, the default value is \fBcmd /s/c\fR when \fB$SHELL\fR is not
1259 set.
1260
1261 .TP
1262 .B "\-\-listen[=SOCKET_PATH|[ADDR:]PORT]" "\-\-listen\-unsafe[=[ADDR:]PORT]"
1263 Start HTTP server and listen on the given address or Unix socket. It allows
1264 external processes to send actions to perform via POST method and query the
1265 program state via GET method. For the argument to be recognized as a socket
1266 path, it must have \fB.sock\fR extension.
1267
1268 - If the port number is omitted or given as 0, fzf will automatically choose
1269 a port and export it as \fBFZF_PORT\fR environment variable to the child processes.
1270
1271 - If a Unix socket path is given, fzf will create a Unix domain socket at the
1272 given path. The existing file will be removed. The path to the socket file
1273 is exported as \fBFZF_SOCK\fR environment variable.
1274
1275 - If \fBFZF_API_KEY\fR environment variable is set, the server would require
1276 sending an API key with the same value in the \fBx\-api\-key\fR HTTP header.
1277
1278 - \fBFZF_API_KEY\fR is required for a non-localhost listen address.
1279
1280 - To allow remote process execution, use \fB\-\-listen\-unsafe\fR.
1281
1282 e.g.
1283 \fB# Start HTTP server on port 6266
1284 fzf \-\-listen 6266
1285
1286 # Send action to the server
1287 curl \-XPOST localhost:6266 \-d 'reload(seq 100)+change\-prompt(hundred> )'
1288
1289 # Start HTTP server on port 6266 with remote connections allowed
1290 # * Listening on non-localhost address requires using an API key
1291 export FZF_API_KEY="$(head \-c 32 /dev/urandom | base64)"
1292 fzf \-\-listen 0.0.0.0:6266
1293
1294 # Send an authenticated action
1295 curl \-XPOST localhost:6266 \-H "x\-api\-key: $FZF_API_KEY" \-d 'change\-query(yo)'
1296
1297 # Choose port automatically and export it as $FZF_PORT to the child process
1298 fzf \-\-listen \-\-bind 'start:execute\-silent:echo $FZF_PORT > /tmp/fzf\-port'
1299
1300 # Get program state in JSON format (experimental)
1301 # - GET Parameters:
1302 # - limit: number of items to return (default: 100)
1303 # - offset: number of items to skip (default: 0)
1304 curl localhost:6266
1305
1306 # Automatically select items with .txt extension
1307 fzf \-\-multi \-\-sync \-\-listen \-\-bind 'load:transform:
1308 pos=1
1309 curl \-s localhost:$FZF_PORT?limit=1000 | jq \-r .matches[].text | while read \-r text; do
1310 if [[ $text =~ \\.txt$ ]]; then
1311 echo \-n "+pos($pos)+select"
1312 fi
1313 pos=$((pos + 1))
1314 done
1315 echo +first
1316 '
1317 \fR
1318
1319 Here is an example script that uses a Unix socket instead of a TCP port.
1320
1321 \fB
1322 fzf --listen=/tmp/fzf.sock
1323
1324 # GET
1325 curl --unix-socket /tmp/fzf.sock http
1326
1327 # POST
1328 curl --unix-socket /tmp/fzf.sock http -d up
1329 \fR
1330
1331 .TP
1332 .BI "\-\-threads=" "N"
1333 Number of matcher threads to use. The default value is
1334 \fBmin(8 * NUM_CPU, 32)\fR.
1335 .TP
1336 .BI "\-\-bench=" "DURATION"
1337 Repeatedly run \fB\-\-filter\fR for the given duration and print timing
1338 statistics. Must be used with \fB\-\-filter\fR.
1339
1340 e.g.
1341 \fBcat /usr/share/dict/words | fzf \-\-filter abc \-\-bench 10s\fR
1342
1343 .SS DIRECTORY TRAVERSAL
1344 .TP
1345 .B "\-\-walker=[file][,dir][,follow][,hidden]"
1346 Determines the behavior of the built-in directory walker that is used when
1347 \fB$FZF_DEFAULT_COMMAND\fR is not set. The default value is \fBfile,follow,hidden\fR.
1348
1349 * \fBfile\fR: Include files in the search result
1350 .br
1351 * \fBdir\fR: Include directories in the search result
1352 .br
1353 * \fBhidden\fR: Include and follow hidden directories
1354 .br
1355 * \fBfollow\fR: Follow symbolic links
1356 .br
1357
1358 .TP
1359 .B "\-\-walker\-root=DIR [...]"
1360 List of directory names to start the built-in directory walker.
1361 The default value is the current working directory.
1362
1363 .TP
1364 .B "\-\-walker\-skip=DIRS"
1365 Comma-separated list of directory names to skip during the directory walk.
1366 The default value is \fB.git,node_modules\fR.
1367
1368 .SS HISTORY
1369 .TP
1370 .BI "\-\-history=" "HISTORY_FILE"
1371 Load search history from the specified file and update the file on completion.
1372 When enabled, \fBCTRL\-N\fR and \fBCTRL\-P\fR are automatically remapped to
1373 \fBnext\-history\fR and \fBprev\-history\fR.
1374 .TP
1375 .BI "\-\-history\-size=" "N"
1376 Maximum number of entries in the history file (default: 1000). The file is
1377 automatically truncated when the number of the lines exceeds the value.
1378
1379 .RS
1380 e.g. \fBgem list | fzf \-\-with\-shell 'ruby \-e' \-\-preview 'pp Gem::Specification.find_by_name({1})'\fR
1381 .RE
1382
1383 .SS SHELL INTEGRATION
1384 .TP
1385 .B "\-\-bash"
1386 Print script to set up Bash shell integration
1387
1388 e.g. \fBeval "$(fzf \-\-bash)"\fR
1389
1390 .TP
1391 .B "\-\-zsh"
1392 Print script to set up Zsh shell integration
1393
1394 e.g. \fBsource <(fzf \-\-zsh)\fR
1395
1396 .TP
1397 .B "\-\-fish"
1398 Print script to set up Fish shell integration
1399
1400 e.g. \fBfzf \-\-fish | source\fR
1401
1402 .TP
1403 .B "\-\-nushell"
1404 Print script to set up Nushell shell integration
1405
1406 e.g. \fBfzf \-\-nushell | save \-f ~/.config/nushell/autoload/_fzf_integration.nu\fR
1407
1408 .SS OTHERS
1409 .TP
1410 .B "\-\-no\-mouse"
1411 Disable mouse
1412 .TP
1413 .B "\-\-no\-unicode"
1414 Use ASCII characters instead of Unicode drawing characters to draw borders,
1415 the spinner and the horizontal separator.
1416
1417 .TP
1418 .B "\-\-ambidouble"
1419 Set this option if your terminal displays ambiguous width characters (e.g.
1420 box-drawing characters for borders) as 2 columns.
1421
1422 .SS HELP
1423 .TP
1424 .B "\-\-version"
1425 Display version information and exit
1426 .TP
1427 .B "\-\-help"
1428 Show help message
1429 .TP
1430 .B "\-\-man"
1431 Show man page
1432
1433 .SH ENVIRONMENT VARIABLES
1434 .TP
1435 .B FZF_DEFAULT_COMMAND
1436 Default command to use when input is a TTY device. On *nix systems, fzf runs
1437 the command with \fB$SHELL \-c\fR if \fBSHELL\fR is set, otherwise with \fBsh
1438 \-c\fR, so in this case make sure that the command is POSIX-compliant.
1439 .TP
1440 .B FZF_DEFAULT_OPTS
1441 Default options.
1442 .br
1443 e.g. \fBexport FZF_DEFAULT_OPTS="\-\-layout=reverse \-\-border \-\-cycle"\fR
1444 .TP
1445 .B FZF_DEFAULT_OPTS_FILE
1446 The location of the file that contains the default options.
1447 .br
1448 e.g. \fBexport FZF_DEFAULT_OPTS_FILE=~/.fzfrc\fR
1449 .TP
1450 .B FZF_API_KEY
1451 Can be used to require an API key when using \fB\-\-listen\fR option. If not set,
1452 no authentication will be required by the server. You can set this value if
1453 you need to protect against DNS rebinding and privilege escalation attacks.
1454
1455 .SH EXIT STATUS
1456 .BR 0 " Normal exit"
1457 .br
1458 .BR 1 " No match"
1459 .br
1460 .BR 2 " Error"
1461 .br
1462 .BR 126 " Permission denied error from \fBbecome\fR action"
1463 .br
1464 .BR 127 " Invalid shell command for \fBbecome\fR action"
1465 .br
1466 .BR 130 " Interrupted with \fBCTRL\-C\fR or \fBESC\fR"
1467
1468 .SH FIELD INDEX EXPRESSION
1469
1470 A field index expression can be a non-zero integer or a range expression
1471 ([BEGIN]..[END]). \fB\-\-nth\fR and \fB\-\-with\-nth\fR take a comma-separated list
1472 of field index expressions.
1473
1474 .SS Examples
1475 .BR 1 " The 1st field"
1476 .br
1477 .BR 2 " The 2nd field"
1478 .br
1479 .BR \-1 " The last field"
1480 .br
1481 .BR \-2 " The 2nd to last field"
1482 .br
1483 .BR 3..5 " From the 3rd field to the 5th field"
1484 .br
1485 .BR 2.. " From the 2nd field to the last field"
1486 .br
1487 .BR ..\-3 " From the 1st field to the 3rd to the last field"
1488 .br
1489 .BR .. " All the fields"
1490 .br
1491
1492 .SH ENVIRONMENT VARIABLES EXPORTED TO CHILD PROCESSES
1493
1494 fzf exports the following environment variables to its child processes.
1495
1496 .BR FZF_LINES " Number of lines fzf takes up excluding padding and margin"
1497 .br
1498 .BR FZF_COLUMNS " Number of columns fzf takes up excluding padding and margin"
1499 .br
1500 .BR FZF_DIRECTION " Direction of the list (\fBup\fR or \fBdown\fR)"
1501 .br
1502 .BR FZF_TOTAL_COUNT " Total number of items"
1503 .br
1504 .BR FZF_MATCH_COUNT " Number of matched items"
1505 .br
1506 .BR FZF_SELECT_COUNT " Number of selected items"
1507 .br
1508 .BR FZF_POS " Vertical position of the cursor in the list starting from 1"
1509 .br
1510 .BR FZF_CURRENT_ITEM " Text of the current item (unset if the list is empty)"
1511 .br
1512 .BR FZF_WRAP " The line wrapping mode (char, word) when enabled"
1513 .br
1514 .BR FZF_QUERY " Current query string"
1515 .br
1516 .BR FZF_INPUT_STATE " Current input state (enabled, disabled, hidden)"
1517 .br
1518 .BR FZF_NTH " Current \-\-nth option"
1519 .br
1520 .BR FZF_WITH_NTH " Current \-\-with\-nth option"
1521 .br
1522 .BR FZF_PROMPT " Prompt string"
1523 .br
1524 .BR FZF_GHOST " Ghost string"
1525 .br
1526 .BR FZF_POINTER " Pointer string"
1527 .br
1528 .BR FZF_PREVIEW_LABEL " Preview label string"
1529 .br
1530 .BR FZF_BORDER_LABEL " Border label string"
1531 .br
1532 .BR FZF_LIST_LABEL " List label string"
1533 .br
1534 .BR FZF_INPUT_LABEL " Input label string"
1535 .br
1536 .BR FZF_HEADER_LABEL " Header label string"
1537 .br
1538 .BR FZF_ACTION " The name of the last action performed"
1539 .br
1540 .BR FZF_KEY " The name of the last key pressed"
1541 .br
1542 .BR FZF_IDLE_TIME " Whole seconds since the last user activity"
1543 .br
1544 .BR FZF_IDLE_TIME_MS " Milliseconds since the last user activity"
1545 .br
1546 .BR FZF_PORT " Port number when \-\-listen option is used"
1547 .br
1548 .BR FZF_SOCK " Unix socket path when \-\-listen option is used"
1549 .br
1550 .BR FZF_PREVIEW_TOP " Top position of the preview window"
1551 .br
1552 .BR FZF_PREVIEW_LEFT " Left position of the preview window"
1553 .br
1554 .BR FZF_PREVIEW_LINES " Number of lines in the preview window"
1555 .br
1556 .BR FZF_PREVIEW_COLUMNS " Number of columns in the preview window"
1557 .br
1558 .BR FZF_RAW " Only in raw mode. 1 if the current item matches, 0 otherwise"
1559
1560 .PP
1561 .B FZF_CURRENT_ITEM
1562 is omitted when the item contains a NUL byte, because exec(2) cannot pass it.
1563 It is also omitted when the item is larger than 64 KB, so that a huge item
1564 cannot overflow the environment size limit and break preview and other child
1565 commands.
1566
1567 .SH EXTENDED SEARCH MODE
1568
1569 Unless specified otherwise, fzf will start in "extended\-search mode". In this
1570 mode, you can specify multiple patterns delimited by spaces, such as: \fB'wild
1571 ^music .mp3$ sbtrkt !rmx\fR
1572
1573 You can prepend a backslash to a space (\fB\\ \fR) to match a literal space
1574 character.
1575
1576 .SS Exact\-match (quoted)
1577 A term that is prefixed by a single-quote character (\fB'\fR) is interpreted as
1578 an "exact\-match" (or "non\-fuzzy") term. fzf will search for the exact
1579 occurrences of the string.
1580
1581 .SS Anchored\-match
1582 A term can be prefixed by \fB^\fR, or suffixed by \fB$\fR to become an
1583 anchored-match term. Then fzf will search for the lines that start with or end
1584 with the given string. An anchored-match term is also an exact-match term.
1585
1586 .SS Exact\-boundary\-match (quoted both ends)
1587 A single-quoted term is interpreted as an "exact\-boundary\-match". fzf will
1588 search for the exact occurrences of the string with both ends at the word
1589 boundaries. Unlike in regular expressions, this also sees an underscore as
1590 a word boundary. But the words around underscores are ranked lower and appear
1591 later in the result than the other words around the other types of word
1592 boundaries.
1593
1594 1. xxx foo xxx (highest score)
1595 .br
1596 2. xxx foo_xxx
1597 .br
1598 3. xxx_foo xxx
1599 .br
1600 4. xxx_foo_xxx (lowest score)
1601
1602 .SS Negation
1603 If a term is prefixed by \fB!\fR, fzf will exclude the lines that satisfy the
1604 term from the result. In this case, fzf performs exact match by default.
1605
1606 .SS Exact\-match by default
1607 If you don't prefer fuzzy matching and do not wish to "quote" (prefixing with
1608 \fB'\fR) every word, start fzf with \fB\-e\fR or \fB\-\-exact\fR option. Note that
1609 when \fB\-\-exact\fR is set, \fB'\fR\-prefix "unquotes" the term.
1610
1611 .SS OR operator
1612 A single bar character term acts as an OR operator. For example, the following
1613 query matches entries that start with \fBcore\fR and end with either \fBgo\fR,
1614 \fBrb\fR, or \fBpy\fR.
1615
1616 e.g. \fB^core go$ | rb$ | py$\fR
1617
1618 .SH KEY/EVENT BINDINGS
1619 \fB\-\-bind\fR option allows you to bind \fBa key\fR or \fBan event\fR to one or
1620 more \fBactions\fR. You can use it to customize key bindings or implement
1621 dynamic behaviors.
1622
1623 \fB\-\-bind\fR takes a comma-separated list of binding expressions. Each binding
1624 expression is \fBKEY:ACTION\fR or \fBEVENT:ACTION\fR. You can bind actions to
1625 multiple keys and events by writing comma-separated list of keys and events
1626 before the colon. e.g. \fBKEY1,KEY2,EVENT1,EVENT2:ACTION\fR.
1627
1628 e.g.
1629 \fBfzf \-\-bind=ctrl\-j:accept,ctrl\-k:kill\-line
1630
1631 # Load 'ps \-ef' output on start and reload it on CTRL\-R
1632 fzf \-\-bind 'start,ctrl\-r:reload:ps \-ef'\fR
1633
1634 .SS AVAILABLE KEYS: (SYNONYMS)
1635 \fIctrl\-[a\-z]\fR
1636 .br
1637 \fIctrl\-space\fR
1638 .br
1639 \fIctrl\-delete\fR
1640 .br
1641 \fIctrl\-\\\fR
1642 .br
1643 \fIctrl\-]\fR
1644 .br
1645 \fIctrl\-^\fR (\fIctrl\-6\fR)
1646 .br
1647 \fIctrl\-/\fR (\fIctrl\-_\fR)
1648 .br
1649 \fIctrl\-alt\-[a\-z]\fR (\fIctrl\-alt\-h\fR is \fIctrl\-alt\-backspace\fR on non-Windows)
1650 .br
1651 \fIalt\-[*]\fR (Any case-sensitive single character is allowed)
1652 .br
1653 \fIf[1\-12]\fR
1654 .br
1655 \fIenter\fR (\fIreturn\fR \fIctrl\-m\fR)
1656 .br
1657 \fIspace\fR
1658 .br
1659 \fIbackspace\fR (\fIbspace\fR \fIbs\fR)
1660 .br
1661 \fIalt\-up\fR
1662 .br
1663 \fIalt\-down\fR
1664 .br
1665 \fIalt\-left\fR
1666 .br
1667 \fIalt\-right\fR
1668 .br
1669 \fIalt\-home\fR
1670 .br
1671 \fIalt\-end\fR
1672 .br
1673 \fIalt\-backspace\fR (\fIalt\-bspace\fR \fIalt\-bs\fR)
1674 .br
1675 \fIalt\-delete\fR
1676 .br
1677 \fIalt\-page\-up\fR
1678 .br
1679 \fIalt\-page\-down\fR
1680 .br
1681 \fIalt\-enter\fR
1682 .br
1683 \fIalt\-space\fR
1684 .br
1685 \fItab\fR
1686 .br
1687 \fIshift\-tab\fR (\fIbtab\fR)
1688 .br
1689 \fIesc\fR
1690 .br
1691 \fIdelete\fR (\fIdel\fR)
1692 .br
1693 \fIup\fR
1694 .br
1695 \fIdown\fR
1696 .br
1697 \fIleft\fR
1698 .br
1699 \fIright\fR
1700 .br
1701 \fIhome\fR
1702 .br
1703 \fIend\fR
1704 .br
1705 \fIinsert\fR
1706 .br
1707 \fIpage\-up\fR (\fIpgup\fR)
1708 .br
1709 \fIpage\-down\fR (\fIpgdn\fR)
1710 .br
1711 \fIctrl\-up\fR
1712 .br
1713 \fIctrl\-down\fR
1714 .br
1715 \fIctrl\-left\fR
1716 .br
1717 \fIctrl\-right\fR
1718 .br
1719 \fIctrl\-home\fR
1720 .br
1721 \fIctrl\-end\fR
1722 .br
1723 \fIctrl\-backspace\fR (\fIctrl\-bspace\fR \fIctrl\-bs\fR)
1724 .br
1725 \fIctrl\-delete\fR
1726 .br
1727 \fIctrl\-page\-up\fR
1728 .br
1729 \fIctrl\-page\-down\fR
1730 .br
1731 \fIshift\-up\fR
1732 .br
1733 \fIshift\-down\fR
1734 .br
1735 \fIshift\-left\fR
1736 .br
1737 \fIshift\-right\fR
1738 .br
1739 \fIshift\-home\fR
1740 .br
1741 \fIshift\-end\fR
1742 .br
1743 \fIshift\-delete\fR
1744 .br
1745 \fIshift\-page\-up\fR
1746 .br
1747 \fIshift\-page\-down\fR
1748 .br
1749 \fIalt\-shift\-up\fR
1750 .br
1751 \fIalt\-shift\-down\fR
1752 .br
1753 \fIalt\-shift\-left\fR
1754 .br
1755 \fIalt\-shift\-right\fR
1756 .br
1757 \fIalt\-shift\-home\fR
1758 .br
1759 \fIalt\-shift\-end\fR
1760 .br
1761 \fIalt\-shift\-delete\fR
1762 .br
1763 \fIalt\-shift\-page\-up\fR
1764 .br
1765 \fIalt\-shift\-page\-down\fR
1766 .br
1767 \fIctrl\-alt\-up\fR
1768 .br
1769 \fIctrl\-alt\-down\fR
1770 .br
1771 \fIctrl\-alt\-left\fR
1772 .br
1773 \fIctrl\-alt\-right\fR
1774 .br
1775 \fIctrl\-alt\-home\fR
1776 .br
1777 \fIctrl\-alt\-end\fR
1778 .br
1779 \fIctrl\-alt\-backspace\fR (\fIctrl\-alt\-bspace\fR \fIctrl\-alt\-bs\fR) (\fIctrl\-alt\-h\fR (non-Windows))
1780 .br
1781 \fIctrl\-alt\-delete\fR
1782 .br
1783 \fIctrl\-alt\-page\-up\fR
1784 .br
1785 \fIctrl\-alt\-page\-down\fR
1786 .br
1787 \fIctrl\-shift\-up\fR
1788 .br
1789 \fIctrl\-shift\-down\fR
1790 .br
1791 \fIctrl\-shift\-left\fR
1792 .br
1793 \fIctrl\-shift\-right\fR
1794 .br
1795 \fIctrl\-shift\-home\fR
1796 .br
1797 \fIctrl\-shift\-end\fR
1798 .br
1799 \fIctrl\-shift\-delete\fR
1800 .br
1801 \fIctrl\-shift\-page\-up\fR
1802 .br
1803 \fIctrl\-shift\-page\-down\fR
1804 .br
1805 \fIctrl\-alt\-shift\-up\fR
1806 .br
1807 \fIctrl\-alt\-shift\-down\fR
1808 .br
1809 \fIctrl\-alt\-shift\-left\fR
1810 .br
1811 \fIctrl\-alt\-shift\-right\fR
1812 .br
1813 \fIctrl\-alt\-shift\-home\fR
1814 .br
1815 \fIctrl\-alt\-shift\-end\fR
1816 .br
1817 \fIctrl\-alt\-shift\-delete\fR
1818 .br
1819 \fIctrl\-alt\-shift\-page\-up\fR
1820 .br
1821 \fIctrl\-alt\-shift\-page\-down\fR
1822 .br
1823 \fIleft\-click\fR
1824 .br
1825 \fIright\-click\fR
1826 .br
1827 \fIdouble\-click\fR
1828 .br
1829 \fIscroll\-up\fR
1830 .br
1831 \fIscroll\-down\fR
1832 .br
1833 \fIpreview\-scroll\-up\fR
1834 .br
1835 \fIpreview\-scroll\-down\fR
1836 .br
1837 \fIshift\-left\-click\fR
1838 .br
1839 \fIshift\-right\-click\fR
1840 .br
1841 \fIshift\-scroll\-up\fR
1842 .br
1843 \fIshift\-scroll\-down\fR
1844 .br
1845 or any single character
1846
1847 Note that some terminal emulators may not support \fIctrl-*\fR bindings.
1848
1849 .SS AVAILABLE EVENTS:
1850 \fIstart\fR
1851 .RS
1852 Triggered only once when fzf finder starts. Since fzf consumes the input stream
1853 asynchronously, the input list is not available unless you use \fI\-\-sync\fR.
1854
1855 e.g.
1856 \fB# Move cursor to the last item and select all items
1857 seq 1000 | fzf \-\-multi \-\-sync \-\-bind start:last+select\-all\fR
1858 .RE
1859
1860 \fIload\fR
1861 .RS
1862 Triggered when the input stream is complete and the initial processing of the
1863 list is complete.
1864
1865 e.g.
1866 \fB# Change the prompt to "loaded" when the input stream is complete
1867 (seq 10; sleep 1; seq 11 20) | fzf \-\-prompt 'Loading> ' \-\-bind 'load:change\-prompt:Loaded> '\fR
1868 .RE
1869
1870 \fIresize\fR
1871 .RS
1872 Triggered when the terminal size is changed.
1873
1874 e.g.
1875 \fBfzf \-\-bind 'resize:transform\-header:echo Resized: ${FZF_COLUMNS}x${FZF_LINES}'\fR
1876 .RE
1877
1878 \fIresult\fR
1879 .RS
1880 Triggered when the filtering for the current query is complete and the result list is ready.
1881
1882 e.g.
1883 \fB# Put the cursor on the second item when the query string is empty
1884 # * Note that you can't use 'change' event in this case because the second position may not be available
1885 fzf \-\-sync \-\-bind 'result:transform:[[ \-z {q} ]] && echo "pos(2)"'\fR
1886 .RE
1887
1888 \fIresult\-final\fR
1889 .RS
1890 Same as \fIresult\fR, but suppressed while the input stream is still open. Use
1891 this when you want a one-shot action per query instead of one per intermediate
1892 snapshot during loading.
1893
1894 e.g.
1895 \fB# 'result' fires per intermediate snapshot (header keeps updating during load);
1896 # 'result-final' fires once after the stream closes (footer shows the final count)
1897 (seq 100; sleep 1; seq 100) | fzf \-\-query 1 \\
1898 \-\-bind 'result:transform\-header(echo result: $FZF_MATCH_COUNT),result\-final:transform\-footer(echo final: $FZF_MATCH_COUNT)'\fR
1899 .RE
1900
1901 \fIchange\fR
1902 .RS
1903 Triggered whenever the query string is changed
1904
1905 e.g.
1906 \fB# Move cursor to the first entry whenever the query is changed
1907 fzf \-\-bind change:first\fR
1908 .RE
1909 \fIfocus\fR
1910 .RS
1911 Triggered when the focus changes due to a vertical cursor movement or a search
1912 result update.
1913
1914 e.g.
1915 \fBfzf \-\-bind 'focus:transform\-preview\-label:echo [ {} ]' \-\-preview 'cat {}'
1916
1917 # Any action bound to the event runs synchronously and thus can make the interface sluggish
1918 # e.g. lolcat isn't one of the fastest programs, and every cursor movement in
1919 # fzf will be noticeably affected by its execution time
1920 fzf \-\-bind 'focus:transform\-preview\-label:echo [ {} ] | lolcat \-f' \-\-preview 'cat {}'
1921
1922 # Beware not to introduce an infinite loop
1923 seq 10 | fzf \-\-bind 'focus:up' \-\-cycle\fR
1924 .RE
1925 \fImulti\fR
1926 .RS
1927 Triggered when the multi\-selection has changed.
1928 .RE
1929
1930 \fIone\fR
1931 .RS
1932 Triggered when there's only one match. \fBone:accept\fR binding is comparable
1933 to \fB\-\-select\-1\fR option, but the difference is that \fB\-\-select\-1\fR is only
1934 effective before the interactive finder starts but \fBone\fR event is triggered
1935 by the interactive finder.
1936
1937 e.g.
1938 \fB# Automatically select the only match
1939 seq 10 | fzf \-\-bind one:accept\fR
1940 .RE
1941
1942 \fIzero\fR
1943 .RS
1944 Triggered when there's no match. \fBzero:abort\fR binding is comparable to
1945 \fB\-\-exit\-0\fR option, but the difference is that \fB\-\-exit\-0\fR is only
1946 effective before the interactive finder starts but \fBzero\fR event is
1947 triggered by the interactive finder.
1948
1949 e.g.
1950 \fB# Reload the candidate list when there's no match
1951 echo $RANDOM | fzf \-\-bind 'zero:reload(echo $RANDOM)+clear\-query' \-\-height 3\fR
1952 .RE
1953
1954 \fIbackward\-eof\fR
1955 .RS
1956 Triggered when the query string is already empty and you try to delete it
1957 backward.
1958
1959 e.g.
1960 \fBfzf \-\-bind backward\-eof:abort\fR
1961 .RE
1962
1963 \fIjump\fR
1964 .RS
1965 Triggered when successfully jumped to the target item in \fBjump\fR mode.
1966
1967 e.g.
1968 \fBfzf \-\-bind space:jump,jump:accept\fR
1969 .RE
1970
1971 \fIjump\-cancel\fR
1972 .RS
1973 Triggered when \fBjump\fR mode is cancelled.
1974
1975 e.g.
1976 \fBfzf \-\-bind space:jump,jump:accept,jump\-cancel:abort\fR
1977 .RE
1978
1979 \fIclick\-header\fR
1980 .RS
1981 Triggered when a mouse click occurs within the header. Sets
1982 \fBFZF_CLICK_HEADER_LINE\fR and \fBFZF_CLICK_HEADER_COLUMN\fR environment
1983 variables starting from 1. It optionally sets \fBFZF_CLICK_HEADER_WORD\fR and
1984 \fBFZF_CLICK_HEADER_NTH\fR if clicked on a word.
1985
1986 e.g.
1987 \fB# Click on the header line to limit search scope
1988 ps \-ef | fzf \-\-style full \-\-layout reverse \-\-header\-lines 1 \\
1989 \-\-header\-lines\-border bottom \-\-no\-list\-border \\
1990 \-\-color fg:dim,nth:regular \\
1991 \-\-bind 'click\-header:transform\-nth(
1992 echo $FZF_CLICK_HEADER_NTH
1993 )+transform\-prompt(
1994 echo "$FZF_CLICK_HEADER_WORD> "
1995 )'\fR
1996 .RE
1997
1998 \fIclick\-footer\fR
1999 .RS
2000 Triggered when a mouse click occurs within the footer. Sets
2001 \fBFZF_CLICK_FOOTER_LINE\fR and \fBFZF_CLICK_FOOTER_COLUMN\fR environment
2002 variables starting from 1. It optionally sets \fBFZF_CLICK_FOOTER_WORD\fR
2003 if clicked on a word.
2004 .RE
2005
2006 \fIevery(N)\fR
2007 .RS
2008 Triggered every \fIN\fR seconds (\fIN\fR can be a fractional number, e.g.
2009 \fB0.5\fR). The minimum interval is \fB0.01\fR seconds; values are floored
2010 to that.
2011
2012 Combine with the \fBFZF_IDLE_TIME\fR (whole seconds) and
2013 \fBFZF_IDLE_TIME_MS\fR (milliseconds) environment variables to build
2014 idle\-based behavior without a separate event.
2015
2016 e.g.
2017 \fB# Live process list, refreshed every 2 seconds.
2018 # --track --id-nth 2 keeps the cursor on the same PID across reloads.
2019 fzf \-\-header\-lines 1 \-\-track \-\-id\-nth 2 \\
2020 \-\-bind 'start,every(2):reload\-sync:ps \-ef'
2021
2022 # Auto\-accept after 10 seconds of inactivity, with a countdown in the footer after 5s.
2023 fzf \-\-bind 'every(1):bg\-transform:
2024 if [[ $FZF_IDLE_TIME \-lt 5 ]]; then echo change\-footer:
2025 elif [[ $FZF_IDLE_TIME \-lt 10 ]]; then echo "change\-footer:auto\-accept in $((10 \- FZF_IDLE_TIME))s"
2026 else echo accept
2027 fi'\fR
2028 .RE
2029
2030 .SS AVAILABLE ACTIONS:
2031 A key or an event can be bound to one or more of the following actions.
2032
2033 \fBACTION: DEFAULT BINDINGS (NOTES):
2034 \fBabort\fR \fIctrl\-c ctrl\-g ctrl\-q esc\fR
2035 \fBaccept\fR \fIenter double\-click\fR
2036 \fBaccept\-non\-empty\fR (same as \fBaccept\fR except that it prevents fzf from exiting without selection)
2037 \fBaccept\-or\-print\-query\fR (same as \fBaccept\fR except that it prints the query when there's no match)
2038 \fBbackward\-char\fR \fIctrl\-b left\fR
2039 \fBbackward\-delete\-char\fR \fIctrl\-h ctrl\-bspace bspace\fR
2040 \fBbackward\-delete\-char/eof\fR (same as \fBbackward\-delete\-char\fR except aborts fzf if query is empty)
2041 \fBbackward\-kill\-subword\fR
2042 \fBbackward\-kill\-word\fR \fIalt\-bs\fR
2043 \fBbackward\-subword\fR
2044 \fBbackward\-word\fR \fIalt\-b shift\-left alt\-left\fR
2045 \fBbecome(...)\fR (replace fzf process with the specified command; see below for the details)
2046 \fBbeginning\-of\-line\fR \fIctrl\-a home\fR
2047 \fBbell\fR (ring the terminal bell)
2048 \fBbest\fR (move to the best match; same as \fBfirst\fR if raw mode is disabled)
2049 \fBbg\-cancel\fR (cancel background transform processes)
2050 \fBcancel\fR (clear query string if not empty, abort fzf otherwise)
2051 \fBchange\-border\-label(...)\fR (change \fB\-\-border\-label\fR to the given string)
2052 \fBchange\-ghost(...)\fR (change ghost text to the given string)
2053 \fBchange\-header(...)\fR (change header to the given string; doesn't affect \fB\-\-header\-lines\fR)
2054 \fBchange\-header\-lines(N)\fR (change the number of \fB\-\-header\-lines\fR)
2055 \fBchange\-header\-label(...)\fR (change \fB\-\-header\-label\fR to the given string)
2056 \fBchange\-input\-label(...)\fR (change \fB\-\-input\-label\fR to the given string)
2057 \fBchange\-list\-label(...)\fR (change \fB\-\-list\-label\fR to the given string)
2058 \fBchange\-multi\fR (enable multi-select mode with no limit)
2059 \fBchange\-multi(...)\fR (enable multi-select mode with a limit or disable it with 0)
2060 \fBchange\-nth(...)\fR (change \fB\-\-nth\fR option; rotate through the multiple options separated by '|')
2061 \fBchange\-with\-nth(...)\fR (change \fB\-\-with\-nth\fR option; rotate through the multiple options separated by '|')
2062 \fBchange\-pointer(...)\fR (change \fB\-\-pointer\fR option)
2063 \fBchange\-preview(...)\fR (change \fB\-\-preview\fR option)
2064 \fBchange\-preview\-label(...)\fR (change \fB\-\-preview\-label\fR to the given string)
2065 \fBchange\-preview\-window(...)\fR (change \fB\-\-preview\-window\fR option; rotate through the multiple option sets separated by '|')
2066 \fBchange\-prompt(...)\fR (change prompt to the given string)
2067 \fBchange\-query(...)\fR (change query string to the given string)
2068 \fBclear\-screen\fR \fIctrl\-l\fR
2069 \fBclear\-multi\fR (clear multi\-selection)
2070 \fBclose\fR (close preview window if open, abort fzf otherwise)
2071 \fBclear\-query\fR (clear query string)
2072 \fBdelete\-char\fR \fIdel\fR
2073 \fBdelete\-char/eof\fR \fIctrl\-d\fR (same as \fBdelete\-char\fR except aborts fzf if query is empty)
2074 \fBdeselect\fR
2075 \fBdeselect\-all\fR (deselect all matches; to also clear non-matching selections, use \fBclear\-multi\fR)
2076 \fBdisable\-raw\fR (disable raw mode)
2077 \fBdisable\-search\fR (disable search functionality)
2078 \fBdown\fR \fIctrl\-j down\fR
2079 \fBdown\-match\fR \fIctrl\-n\fR \fIalt\-down\fR (move to the match below the cursor)
2080 \fBdown\-selected\fR (move to the selected item below the cursor)
2081 \fBenable\-raw\fR (enable raw mode)
2082 \fBenable\-search\fR (enable search functionality)
2083 \fBend\-of\-line\fR \fIctrl\-e end\fR
2084 \fBexclude\fR (exclude the current item from the result)
2085 \fBexclude\-multi\fR (exclude the selected items or the current item from the result)
2086 \fBexecute(...)\fR (see below for the details)
2087 \fBexecute\-silent(...)\fR (see below for the details)
2088 \fBfirst\fR (move to the first match; same as \fBpos(1)\fR)
2089 \fBforward\-char\fR \fIctrl\-f right\fR
2090 \fBforward\-subword\fR
2091 \fBforward\-word\fR \fIalt\-f shift\-right alt\-right\fR
2092 \fBignore\fR
2093 \fBjump\fR (EasyMotion-like 2-keystroke movement)
2094 \fBkill\-line\fR
2095 \fBkill\-subword\fR
2096 \fBkill\-word\fR \fIalt\-d\fR
2097 \fBlast\fR (move to the last match; same as \fBpos(\-1)\fR)
2098 \fBnext\-history\fR (\fIctrl\-n\fR on \fB\-\-history\fR)
2099 \fBnext\-selected\fR (synonym to \fBdown\-selected\fR)
2100 \fBpage\-down\fR \fIpgdn\fR
2101 \fBpage\-up\fR \fIpgup\fR
2102 \fBhalf\-page\-down\fR
2103 \fBhalf\-page\-up\fR
2104 \fBhide\-header\fR
2105 \fBhide\-input\fR
2106 \fBhide\-preview\fR
2107 \fBoffset\-down\fR (similar to CTRL\-E of Vim)
2108 \fBoffset\-up\fR (similar to CTRL\-Y of Vim)
2109 \fBoffset\-middle\fR (place the current item is in the middle of the screen)
2110 \fBpos(...)\fR (move cursor to the numeric position; negative number to count from the end)
2111 \fBprev\-history\fR (\fIctrl\-p\fR on \fB\-\-history\fR)
2112 \fBprev\-selected\fR (synonym to \fBup\-selected\fR)
2113 \fBpreview(...)\fR (see below for the details)
2114 \fBpreview\-down\fR \fIshift\-down\fR
2115 \fBpreview\-up\fR \fIshift\-up\fR
2116 \fBpreview\-page\-down\fR
2117 \fBpreview\-page\-up\fR
2118 \fBpreview\-half\-page\-down\fR
2119 \fBpreview\-half\-page\-up\fR
2120 \fBpreview\-bottom\fR
2121 \fBpreview\-top\fR
2122 \fBprint(...)\fR (add string to the output queue and print on normal exit)
2123 \fBput\fR (put the character to the prompt)
2124 \fBput(...)\fR (put the given string to the prompt)
2125 \fBrefresh\-preview\fR
2126 \fBrebind(...)\fR (rebind bindings after \fBunbind\fR)
2127 \fBreload(...)\fR (see below for the details)
2128 \fBreload\-sync(...)\fR (see below for the details)
2129 \fBreplace\-query\fR (replace query string with the current selection)
2130 \fBsearch(...)\fR (trigger fzf search with the given string)
2131 \fBselect\fR
2132 \fBselect\-all\fR (select all matches)
2133 \fBshow\-header\fR
2134 \fBshow\-input\fR
2135 \fBshow\-preview\fR
2136 \fBtoggle\fR (\fIright\-click\fR)
2137 \fBtoggle\-all\fR (toggle all matches)
2138 \fBtoggle\-in\fR (\fB\-\-layout=reverse*\fR ? \fBtoggle+up\fR : \fBtoggle+down\fR)
2139 \fBtoggle\-out\fR (\fB\-\-layout=reverse*\fR ? \fBtoggle+down\fR : \fBtoggle+up\fR)
2140 \fBtoggle\-bind\fR
2141 \fBtoggle\-header\fR
2142 \fBtoggle\-hscroll\fR
2143 \fBtoggle\-input\fR
2144 \fBtoggle\-multi\-line\fR
2145 \fBtoggle\-preview\fR
2146 \fBtoggle\-preview\-wrap\fR
2147 \fBtoggle\-preview\-wrap\-word\fR
2148 \fBtoggle\-raw\fR (toggle raw mode for displaying non-matching items)
2149 \fBtoggle\-search\fR (toggle search functionality)
2150 \fBtoggle\-sort\fR
2151 \fBtoggle\-track\fR (toggle global tracking option (\fB\-\-track\fR))
2152 \fBtoggle\-track\-current\fR (toggle tracking of the current item)
2153 \fBtoggle\-wrap\fR
2154 \fBtoggle\-wrap\-word\fR \fIctrl\-/\fR \fIalt\-/\fR
2155 \fBtoggle+down\fR \fIctrl\-i (tab)\fR
2156 \fBtoggle+up\fR \fIbtab (shift\-tab)\fR
2157 \fBtrack\-current\fR (track the current item; automatically disabled if focus changes)
2158 \fBtransform(...)\fR (transform states using the output of an external command)
2159 \fBtransform\-border\-label(...)\fR (transform border label using an external command)
2160 \fBtransform\-ghost(...)\fR (transform ghost text using an external command)
2161 \fBtransform\-header(...)\fR (transform header using an external command)
2162 \fBtransform\-header\-lines(...)\fR (transform the number of \fB\-\-header\-lines\fR using an external command)
2163 \fBtransform\-header\-label(...)\fR (transform header label using an external command)
2164 \fBtransform\-input\-label(...)\fR (transform input label using an external command)
2165 \fBtransform\-list\-label(...)\fR (transform list label using an external command)
2166 \fBtransform\-nth(...)\fR (transform nth using an external command)
2167 \fBtransform\-with\-nth(...)\fR (transform with-nth using an external command)
2168 \fBtransform\-pointer(...)\fR (transform pointer using an external command)
2169 \fBtransform\-preview\-label(...)\fR (transform preview label using an external command)
2170 \fBtransform\-prompt(...)\fR (transform prompt string using an external command)
2171 \fBtransform\-query(...)\fR (transform query string using an external command)
2172 \fBtransform\-search(...)\fR (trigger fzf search with the output of an external command)
2173 \fBtrigger(...)\fR (trigger actions bound to a comma-separated list of keys and events)
2174 \fBunbind(...)\fR (unbind bindings)
2175 \fBunix\-line\-discard\fR \fIctrl\-u\fR
2176 \fBunix\-word\-rubout\fR \fIctrl\-w\fR
2177 \fBuntrack\-current\fR (stop tracking the current item; no-op if global tracking is enabled)
2178 \fBwait\fR (block action execution until search completes)
2179 \fBup\fR \fIctrl\-k up\fR
2180 \fBup\-match\fR \fIctrl\-p\fR \fIalt\-up\fR (move to the match above the cursor)
2181 \fBup\-selected\fR (move to the selected item above the cursor)
2182 \fByank\fR \fIctrl\-y\fR
2183
2184 Each \fBtransform*\fR action has a corresponding \fBbg\-transform*\fR
2185 variant that runs the command in the background.
2186
2187 .SS ACTION COMPOSITION
2188
2189 Multiple actions can be chained using \fB+\fR separator.
2190
2191 e.g.
2192 \fBfzf \-\-multi \-\-bind 'ctrl\-a:select\-all+accept'\fR
2193 \fBfzf \-\-multi \-\-bind 'ctrl\-a:select\-all' \-\-bind 'ctrl\-a:+accept'\fR
2194
2195 Any action after a terminal action that exits fzf, such as \fBaccept\fR or
2196 \fBabort\fR, is ignored.
2197
2198 .SS ACTION ARGUMENT
2199
2200 An action denoted with \fB(...)\fR suffix takes an argument.
2201
2202 e.g.
2203 \fBfzf \-\-bind 'ctrl\-a:change\-prompt(NewPrompt> )'\fR
2204 \fBfzf \-\-bind 'ctrl\-v:preview(cat {})' \-\-preview\-window hidden\fR
2205
2206 If the argument contains parentheses, fzf may fail to parse the expression. In
2207 that case, you can use any of the following alternative notations to avoid
2208 parse errors.
2209
2210 \fBaction\-name[...]\fR
2211 \fBaction\-name{...}\fR
2212 \fBaction\-name<...>\fR
2213 \fBaction\-name~...~\fR
2214 \fBaction\-name!...!\fR
2215 \fBaction\-name@...@\fR
2216 \fBaction\-name#...#\fR
2217 \fBaction\-name$...$\fR
2218 \fBaction\-name%...%\fR
2219 \fBaction\-name^...^\fR
2220 \fBaction\-name&...&\fR
2221 \fBaction\-name*...*\fR
2222 \fBaction\-name;...;\fR
2223 \fBaction\-name/.../\fR
2224 \fBaction\-name|...|\fR
2225 \fBaction\-name:...\fR
2226 .RS
2227 The last one is the special form that frees you from parse errors as it does
2228 not expect the closing character. The catch is that it should be the last one
2229 in the comma-separated list of key-action pairs.
2230 .RE
2231
2232 .SS COMMAND EXECUTION
2233
2234 With \fBexecute(...)\fR action, you can execute arbitrary commands without
2235 leaving fzf. For example, you can turn fzf into a simple file browser by
2236 binding \fBenter\fR key to \fBless\fR command like follows.
2237
2238 \fBfzf \-\-bind "enter:execute(less {})"\fR
2239
2240 You can use the same placeholder expressions as in \fB\-\-preview\fR.
2241
2242 fzf switches to the alternate screen when executing a command. However, if the
2243 command is expected to complete quickly, and you are not interested in its
2244 output, you might want to use \fBexecute\-silent\fR instead, which silently
2245 executes the command without the switching. Note that fzf will not be
2246 responsive until the command is complete. For asynchronous execution, start
2247 your command as a background process (i.e. appending \fB&\fR).
2248
2249 On *nix systems, fzf runs the command with \fB$SHELL \-c\fR if \fBSHELL\fR is
2250 set, otherwise with \fBsh \-c\fR, so in this case make sure that the command is
2251 POSIX-compliant.
2252
2253 \fBbecome(...)\fR action is similar to \fBexecute(...)\fR, but it replaces the
2254 current fzf process with the specified command using \fBexecve(2)\fR system
2255 call.
2256
2257 \fBfzf \-\-bind "enter:become(vim {})"\fR
2258
2259 .SS RELOAD INPUT
2260
2261 \fBreload(...)\fR action is used to dynamically update the input list
2262 without restarting fzf. It takes the same command template with placeholder
2263 expressions as \fBexecute(...)\fR.
2264
2265 See \fIhttps://github.com/junegunn/fzf/issues/1750\fR for more info.
2266
2267 e.g.
2268 \fB# Update the list of processes by pressing CTRL\-R
2269 ps \-ef | fzf \-\-bind 'ctrl\-r:reload(ps \-ef)' \-\-header 'Press CTRL\-R to reload' \\
2270 \-\-header\-lines=1 \-\-layout=reverse
2271
2272 # Integration with ripgrep
2273 RG_PREFIX="rg \-\-column \-\-line\-number \-\-no\-heading \-\-color=always \-\-smart\-case "
2274 INITIAL_QUERY="foobar"
2275 FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \\
2276 fzf \-\-bind "change:reload:$RG_PREFIX {q} || true" \\
2277 \-\-ansi \-\-disabled \-\-query "$INITIAL_QUERY"\fR
2278
2279 \fBreload\-sync(...)\fR is a synchronous version of \fBreload\fR that replaces
2280 the list only when the command is complete. This is useful when the command
2281 takes a while to produce the initial output and you don't want fzf to run
2282 against an empty list while the command is running.
2283
2284
2285 e.g.
2286 \fB# You can still filter and select entries from the initial list for 3 seconds
2287 seq 100 | fzf \-\-bind 'load:reload\-sync(sleep 3; seq 1000)+unbind(load)'\fR
2288
2289 .SS TRANSFORM ACTIONS
2290
2291 Actions with \fBtransform\-\fR prefix are used to transform the states of fzf
2292 using the output of an external command. The output of these commands are
2293 expected to be a single line of text.
2294
2295 e.g.
2296 \fBfzf \-\-bind 'focus:transform\-header:file \-\-brief {}'\fR
2297
2298 \fBtransform(...)\fR action runs an external command that should print a series
2299 of actions to be performed. The output should be in the same format as the
2300 payload of HTTP POST request to the \fB\-\-listen\fR server.
2301
2302 e.g.
2303 \fB# Disallow selecting an empty line
2304 printf "1. Hello\\n2. Goodbye\\n\\n3. Exit" |
2305 fzf \-\-height '~100%' \-\-reverse \-\-header 'Select one' \\
2306 \-\-bind 'enter:transform:[[ \-n {} ]] &&
2307 echo accept ||
2308 echo "change\-header:Invalid selection"'
2309 \fR
2310
2311 A common mistake when writing a \fBtransform\fR action is not escaping
2312 placeholder expressions when passing them back to fzf. In the following
2313 example, if you don't escape \fB{}\fR, fzf will immediately replace it with the
2314 single-quoted string of the current item. This causes single quotes to appear
2315 in the header and footer, and the script will break if any item contains
2316 double-quote characters.
2317
2318 \fBfzf \-\-bind 'focus:transform:[[ $FZF_ACTION =~ up ]] &&
2319 echo "change\-header()+transform\-footer:echo \\{}" ||
2320 echo "change\-footer()+transform\-header:echo \\{}"'\fR
2321
2322 .SS TRANSFORM IN THE BACKGROUND
2323
2324 Transform actions are synchronous, meaning fzf becomes unresponsive while the
2325 command runs. To avoid this, each \fBtransform*\fR action has a corresponding
2326 \fBbg\-transform*\fR variant that runs in the background. Unless you need to
2327 chain multiple transform actions where later ones depend on earlier results,
2328 prefer using the \fBbg\fR variant. To cancel currently running background
2329 transform processes, use \fBbg\-cancel\fR action.
2330
2331 .SS WAITING FOR SEARCH COMPLETION
2332
2333 The \fBwait\fR action blocks the execution of subsequent actions until the
2334 current search completes. This is useful when chaining query\-changing actions
2335 with motion actions like \fBbest\fR or \fBfirst\fR, ensuring that the motion
2336 action operates on the complete search results rather than stale data.
2337
2338 e.g.
2339 \fBfzf \-\-bind 'start:change\-query(foo)+wait+best'\fR
2340
2341 In this example, \fBchange\-query(foo)\fR starts an asynchronous search for
2342 the new query, \fBwait\fR blocks until the search completes, and \fBbest\fR
2343 then moves the cursor to the best match in the complete result set.
2344
2345 The initial loading of the input is also considered a search in progress, so
2346 \fBstart:wait\fR can be used to block until the input is fully loaded and
2347 searched.
2348
2349 While waiting, user input is ignored, except for keys bound to \fBabort\fR or
2350 \fBcancel\fR (\fIctrl\-c\fR, \fIctrl\-g\fR, \fIctrl\-q\fR, and \fIesc\fR by
2351 default), which cancel the wait and discard the pending actions instead of
2352 performing their usual role. The remaining actions of such a binding still run,
2353 so a binding like \fBesc:cancel+first\fR is possible.
2354
2355 Asynchronous \fBbg\-transform\-*\fR actions are not affected; their results are
2356 applied as soon as they arrive, even while waiting. For the same reason,
2357 \fBwait\fR does not pair with them: in
2358 \fBbg\-transform\-query(...)+wait\fR, the background command completes only
2359 after \fBwait\fR has already been evaluated, so the search its result
2360 eventually triggers is not waited for. Use the synchronous
2361 \fBtransform\-query(...)\fR variant instead when chaining with \fBwait\fR.
2362
2363 If the search takes long enough, fzf indicates that it is waiting by dimming the
2364 input, hiding the cursor, and showing \fB(..)\fR on the info line. This visual
2365 feedback is debounced so that quick searches do not cause flickering.
2366
2367 Note that when searches are triggered in rapid succession (e.g. via
2368 \fB\-\-listen\fR), \fBwait\fR may unblock on the completion of an earlier
2369 search. Also, if the input source never completes, \fBwait\fR will block until
2370 cancelled.
2371
2372 .SS PREVIEW BINDING
2373
2374 With \fBpreview(...)\fR action, you can specify multiple different preview
2375 commands in addition to the default preview command given by \fB\-\-preview\fR
2376 option.
2377
2378 e.g.
2379 # Default preview command with an extra preview binding
2380 fzf \-\-preview 'file {}' \-\-bind '?:preview:cat {}'
2381
2382 # A preview binding with no default preview command
2383 # (Preview window is initially empty)
2384 fzf \-\-bind '?:preview:cat {}'
2385
2386 # Preview window hidden by default, it appears when you first hit '?'
2387 fzf \-\-bind '?:preview:cat {}' \-\-preview\-window hidden
2388
2389 .SS CHANGE PREVIEW WINDOW ATTRIBUTES
2390
2391 \fBchange\-preview\-window\fR action can be used to change the properties of the
2392 preview window. Unlike the \fB\-\-preview\-window\fR option, you can specify
2393 multiple sets of options separated by '|' characters.
2394
2395 e.g.
2396 # Rotate through the options using CTRL\-/
2397 fzf \-\-preview 'cat {}' \-\-bind 'ctrl\-/:change\-preview\-window(right,70%|down,40%,border\-horizontal|hidden|right)'
2398
2399 # The default properties given by `\-\-preview\-window` are inherited, so an empty string in the list is interpreted as the default
2400 fzf \-\-preview 'cat {}' \-\-preview\-window 'right,40%,border\-left' \-\-bind 'ctrl\-/:change\-preview\-window(70%|down,border\-top|hidden|)'
2401
2402 # This is equivalent to toggle\-preview action
2403 fzf \-\-preview 'cat {}' \-\-bind 'ctrl\-/:change\-preview\-window(hidden|)'
2404
2405 .SH AUTHOR
2406 Junegunn Choi (\[email protected]\fR)
2407
2408 .SH SEE ALSO
2409 .B Project homepage:
2410 .RS
2411 .I https://github.com/junegunn/fzf
2412 .RE
2413 .br
2414
2415 .br
2416 .B Extra Vim plugin:
2417 .RS
2418 .I https://github.com/junegunn/fzf.vim
2419 .RE
2420
2421 .SH LICENSE
2422 MIT