Skip to content
Myr

[man] Escape hyphens to prevent conversion to Unicode hyphens (#3885)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

ASCII hyphens (U+002D HYPHEN-MINUS) in the option names (e.g. -x and --extended) and the code examples in the man pages should be escaped as \- (e.g. \-x and \-\-extended) to prevent them being converted to Unicode hyphens in some environments. For example, in openSUSE Tumbleweed, the raw ASCII hyphens in the man-page sources are configured to be the Unicode hyphen (U+2010 HYPHEN). This makes it impossible to search the option name in the man page by e.g. /--extended[RET]. A problem also arises in copying and pasting option names and code examples from the man page. It appears to be the normal ASCII hyphens by appearance (in typical terminal fonts) but are not recognized as the ASCII hyphens by the `fzf` command.

authored by Koichi Murase · committed by GitHub · parent a70ea46 · Browse files · 2 files+481 added−481 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+481 added−481 removed

  • other:+481 added−481 removed

2 files+481 added−481 removed

modified:man/man1/fzf-tmux.1+15 added-15 removed
19 unmodified lines
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN22THE SOFTWARE.23..24.TH fzf-tmux 1 "Jun 2024" "fzf 0.53.0" "fzf-tmux - open fzf in tmux split pane"24.TH fzf\-tmux 1 "Jun 2024" "fzf 0.53.0" "fzf\-tmux - open fzf in tmux split pane"2526.SH NAME27fzf-tmux - open fzf in tmux split pane27fzf\-tmux - open fzf in tmux split pane2829.SH SYNOPSIS30.B fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS]30.B fzf\-tmux [LAYOUT OPTIONS] [\-\-] [FZF OPTIONS]3132.SH DESCRIPTION33fzf-tmux is a wrapper script for fzf that opens fzf in a tmux split pane or in33fzf\-tmux is a wrapper script for fzf that opens fzf in a tmux split pane or in34a tmux popup window. It is designed to work just like fzf except that it does35not take up the whole screen. You can safely use fzf-tmux instead of fzf in35not take up the whole screen. You can safely use fzf\-tmux instead of fzf in36your scripts as the extra options will be silently ignored if you're not on37tmux.3839.SH LAYOUT OPTIONS4041(default layout: \fB-d 50%\fR)41(default layout: \fB\-d 50%\fR)4243.SS Popup window44(requires tmux 3.2 or above)45.TP46.B "-p [WIDTH[%][,HEIGHT[%]]]"46.B "\-p [WIDTH[%][,HEIGHT[%]]]"47.TP48.B "-w WIDTH[%]"48.B "\-w WIDTH[%]"49.TP50.B "-h WIDTH[%]"50.B "\-h WIDTH[%]"51.TP52.B "-x COL"52.B "\-x COL"53.TP54.B "-y ROW"54.B "\-y ROW"5556.SS Split pane57.TP58.B "-u [height[%]]"58.B "\-u [height[%]]"59Split above (up)60.TP61.B "-d [height[%]]"61.B "\-d [height[%]]"62Split below (down)63.TP64.B "-l [width[%]]"64.B "\-l [width[%]]"65Split left66.TP67.B "-r [width[%]]"67.B "\-r [width[%]]"68Split right
modified:man/man1/fzf.1+466 added-466 removed
36 unmodified lines
3738.SH OPTIONS39.SS Note40.TP41Most long options have the opposite version with \fB--no-\fR prefix.41Most long options have the opposite version with \fB\-\-no\-\fR prefix.4243.SS Search mode44.TP45.B "-x, --extended"45.B "\-x, \-\-extended"46Extended-search mode. Since 0.10.9, this is enabled by default. You can disable47it with \fB+x\fR or \fB--no-extended\fR.47it with \fB+x\fR or \fB\-\-no\-extended\fR.48.TP49.B "-e, --exact"49.B "\-e, \-\-exact"50Enable exact-match51.TP52.B "-i, --ignore-case"52.B "\-i, \-\-ignore\-case"53Case-insensitive match (default: smart-case match)54.TP55.B "+i, --no-ignore-case"55.B "+i, \-\-no\-ignore\-case"56Case-sensitive match57.TP58.B "--literal"58.B "\-\-literal"59Do not normalize latin script letters for matching.60.TP61.BI "--scheme=" SCHEME61.BI "\-\-scheme=" SCHEME62Choose scoring scheme tailored for different types of input.6364.RS65.B default
16 unmodified lines
82.RS83Scoring scheme well suited for command history or any input where chronological84ordering is important. No additional bonus points are given so that we give85more weight to the chronological ordering. This also sets86\fB--tiebreak=index\fR.86\fB\-\-tiebreak=index\fR.87.RE88.RE8990.TP91.BI "--algo=" TYPE91.BI "\-\-algo=" TYPE92Fuzzy matching algorithm (default: v2)9394.br95.BR v2 " Optimal scoring algorithm (quality)"
1 unmodified line
97.BR v1 " Faster but not guaranteed to find the optimal result (performance)"98.br99100.TP101.BI "-n, --nth=" "N[,..]"101.BI "\-n, \-\-nth=" "N[,..]"102Comma-separated list of field index expressions for limiting search scope.103See \fBFIELD INDEX EXPRESSION\fR for the details. When you use this option with104\fB--with-nth\fR, the field index expressions are calculated against the105transformed lines (unlike in \fB--preview\fR where fields are extracted from104\fB\-\-with\-nth\fR, the field index expressions are calculated against the105transformed lines (unlike in \fB\-\-preview\fR where fields are extracted from106the original lines) because fzf doesn't allow searching against the hidden107fields.108.TP109.BI "--with-nth=" "N[,..]"109.BI "\-\-with\-nth=" "N[,..]"110Transform the presentation of each line using field index expressions111.TP112.BI "-d, --delimiter=" "STR"113Field delimiter regex for \fB--nth\fR, \fB--with-nth\fR, and field index112.BI "\-d, \-\-delimiter=" "STR"113Field delimiter regex for \fB\-\-nth\fR, \fB\-\-with\-nth\fR, and field index114expressions (default: AWK-style)115.TP116.BI "--disabled"116.BI "\-\-disabled"117Do not perform search. With this option, fzf becomes a simple selector118interface rather than a "fuzzy finder". You can later enable the search using119\fBenable-search\fR or \fBtoggle-search\fR action.119\fBenable\-search\fR or \fBtoggle\-search\fR action.120.SS Search result121.TP122.B "+s, --no-sort"122.B "+s, \-\-no\-sort"123Do not sort the result124.TP125.B "--tail=NUM"125.B "\-\-tail=NUM"126Maximum number of items to keep in memory. This is useful when you want to127browse an endless stream of data (e.g. log stream) with fzf while limiting128memory usage.129.RS130e.g.131 \fB# Interactive filtering of a log stream132 tail -f *.log | fzf --tail 100000 --tac --no-sort --exact\fR132 tail \-f *.log | fzf \-\-tail 100000 \-\-tac \-\-no\-sort \-\-exact\fR133.RE134.TP135.B "--track"135.B "\-\-track"136Make fzf track the current selection when the result list is updated.137This can be useful when browsing logs using fzf with sorting disabled. It is138not recommended to use this option with \fB--tac\fR as the resulting behavior138not recommended to use this option with \fB\-\-tac\fR as the resulting behavior139can be confusing. Also, consider using \fBtrack\fR action instead of this140option.141142.RS143e.g.144 \fBgit log --oneline --graph --color=always | nl |145 fzf --ansi --track --no-sort --layout=reverse-list\fR144 \fBgit log \-\-oneline \-\-graph \-\-color=always | nl |145 fzf \-\-ansi \-\-track \-\-no\-sort \-\-layout=reverse\-list\fR146.RE147.TP148.B "--tac"148.B "\-\-tac"149Reverse the order of the input150151.RS152e.g.153 \fBhistory | fzf --tac --no-sort\fR153 \fBhistory | fzf \-\-tac \-\-no\-sort\fR154.RE155.TP156.BI "--tiebreak=" "CRI[,..]"156.BI "\-\-tiebreak=" "CRI[,..]"157Comma-separated list of sort criteria to apply when the scores are tied.158.br159160.br
19 unmodified lines
180.br181- If \fBend\fR is found in the list, fzf will scan each line backwards182.SS Interface183.TP184.B "-m, --multi"185Enable multi-select with tab/shift-tab. It optionally takes an integer argument184.B "\-m, \-\-multi"185Enable multi-select with tab/shift\-tab. It optionally takes an integer argument186which denotes the maximum number of items that can be selected.187.TP188.B "+m, --no-multi"188.B "+m, \-\-no\-multi"189Disable multi-select190.TP191.B "--no-mouse"191.B "\-\-no\-mouse"192Disable mouse193.TP194.BI "--bind=" "KEYBINDS"194.BI "\-\-bind=" "KEYBINDS"195Comma-separated list of custom key bindings. See \fBKEY/EVENT BINDINGS\fR for196the details.197.TP198.B "--cycle"198.B "\-\-cycle"199Enable cyclic scroll200.TP201.B "--no-multi-line"202Disable multi-line display of items when using \fB--read0\fR201.B "\-\-no\-multi\-line"202Disable multi-line display of items when using \fB\-\-read0\fR203.TP204.B "--keep-right"204.B "\-\-keep\-right"205Keep the right end of the line visible when it's too long. Effective only when206the query string is empty.207.TP208.BI "--scroll-off=" "LINES"208.BI "\-\-scroll\-off=" "LINES"209Number of screen lines to keep above or below when scrolling to the top or to210the bottom (default: 3).211.TP212.B "--no-hscroll"212.B "\-\-no\-hscroll"213Disable horizontal scroll214.TP215.BI "--hscroll-off=" "COLS"215.BI "\-\-hscroll\-off=" "COLS"216Number of screen columns to keep to the right of the highlighted substring217(default: 10). Setting it to a large value will cause the text to be positioned218on the center of the screen.219.TP220.B "--filepath-word"220.B "\-\-filepath\-word"221Make word-wise movements and actions respect path separators. The following222actions are affected:223224\fBbackward-kill-word\fR224\fBbackward\-kill\-word\fR225.br226\fBbackward-word\fR226\fBbackward\-word\fR227.br228\fBforward-word\fR228\fBforward\-word\fR229.br230\fBkill-word\fR230\fBkill\-word\fR231.TP232.BI "--jump-labels=" "CHARS"232.BI "\-\-jump\-labels=" "CHARS"233Label characters for \fBjump\fR mode.234.SS Layout235.TP236.BI "--height=" "[~]HEIGHT[%]"236.BI "\-\-height=" "[~]HEIGHT[%]"237Display fzf window below the cursor with the given height instead of using238the full screen.239240If a negative value is specified, the height is calculated as the terminal241height minus the given value.242243 fzf --height=-1243 fzf \-\-height=\-1244245When prefixed with \fB~\fR, fzf will automatically determine the height in the246range according to the input size.247248 # Will not take up 100% of the screen249 seq 5 | fzf --height=~100%249 seq 5 | fzf \-\-height=~100%250251Adaptive height has the following limitations:252.br253* Cannot be used with top/bottom margin and padding given in percent size
2 unmodified lines
256.br257* It will not find the right size when there are multi-line items258259.TP260.BI "--min-height=" "HEIGHT"261Minimum height when \fB--height\fR is given in percent (default: 10).262Ignored when \fB--height\fR is not specified.260.BI "\-\-min\-height=" "HEIGHT"261Minimum height when \fB\-\-height\fR is given in percent (default: 10).262Ignored when \fB\-\-height\fR is not specified.263.TP264.BI "--tmux" "[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]]]"264.BI "\-\-tmux" "[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]]]"265Start fzf in a tmux popup (default \fBcenter,50%\fR). Requires tmux 3.3 or266later. This option is ignored if you are not running fzf inside tmux.267268e.g.269 \fB# Popup in the center with 70% width and height270 fzf --tmux 70%270 fzf \-\-tmux 70%271272 # Popup on the left with 40% width and 100% height273 fzf --tmux right,40%273 fzf \-\-tmux right,40%274275 # Popup on the bottom with 100% width and 30% height276 fzf --tmux bottom,30%276 fzf \-\-tmux bottom,30%277278 # Popup on the top with 80% width and 40% height279 fzf --tmux top,80%,40%\fR279 fzf \-\-tmux top,80%,40%\fR280281.TP282.BI "--layout=" "LAYOUT"282.BI "\-\-layout=" "LAYOUT"283Choose the layout (default: default)284285.br286.BR default " Display from the bottom of the screen"286.BR default " Display from the bottom of the screen"287.br288.BR reverse " Display from the top of the screen"288.BR reverse " Display from the top of the screen"289.br290.BR reverse-list " Display from the top of the screen, prompt at the bottom"290.BR reverse\-list " Display from the top of the screen, prompt at the bottom"291.br292293.TP294.B "--reverse"295A synonym for \fB--layout=reverse\fB294.B "\-\-reverse"295A synonym for \fB\-\-layout=reverse\fB296297.TP298.BI "--border" [=BORDER_OPT]298.BI "\-\-border" [=BORDER_OPT]299Draw border around the finder300301.br302.BR rounded " Border with rounded corners (default)"
23 unmodified lines
326.BR none327.br328329If you use a terminal emulator where each box-drawing character takes3302 columns, try setting \fB--ambidouble\fR. If the border is still not properly331rendered, set \fB--no-unicode\fR.3302 columns, try setting \fB\-\-ambidouble\fR. If the border is still not properly331rendered, set \fB\-\-no\-unicode\fR.332333.TP334.BI "--border-label" [=LABEL]334.BI "\-\-border\-label" [=LABEL]335Label to print on the horizontal border line. Should be used with one of the336following \fB--border\fR options.336following \fB\-\-border\fR options.337338.br339.B * rounded340.br
13 unmodified lines
354.br355e.g.356 \fB# ANSI color codes are supported357 # (with https://github.com/busyloop/lolcat)358 label=$(curl -s http://metaphorpsum.com/sentences/1 | lolcat -f)358 label=$(curl \-s http://metaphorpsum.com/sentences/1 | lolcat \-f)359360 # Border label at the center361 fzf --height=10 --border --border-label="╢ $label ╟" --color=label:italic:black361 fzf \-\-height=10 \-\-border \-\-border\-label="╢ $label ╟" \-\-color=label:italic:black362363 # Left-aligned (positive integer)364 fzf --height=10 --border --border-label="╢ $label ╟" --border-label-pos=3 --color=label:italic:black364 fzf \-\-height=10 \-\-border \-\-border\-label="╢ $label ╟" \-\-border\-label\-pos=3 \-\-color=label:italic:black365366 # Right-aligned (negative integer) on the bottom line (:bottom)367 fzf --height=10 --border --border-label="╢ $label ╟" --border-label-pos=-3:bottom --color=label:italic:black\fR367 fzf \-\-height=10 \-\-border \-\-border\-label="╢ $label ╟" \-\-border\-label\-pos=\-3:bottom \-\-color=label:italic:black\fR368369.TP370.BI "--border-label-pos" [=N[:top|bottom]]370.BI "\-\-border\-label\-pos" [=N[:top|bottom]]371Position of the border label on the border line. Specify a positive integer as372the column position from the left. Specify a negative integer to right-align373the label. Label is printed on the top border line by default, add374\fB:bottom\fR to put it on the border line on the bottom. The default value375\fB0 (or \fBcenter\fR) will put the label at the center of the border line.376377.TP378.B "--no-unicode"378.B "\-\-no\-unicode"379Use ASCII characters instead of Unicode drawing characters to draw borders,380the spinner and the horizontal separator.381382.TP383.B "--ambidouble"383.B "\-\-ambidouble"384Set this option if your terminal displays ambiguous width characters (e.g.385box-drawing characters for borders) as 2 columns.386387.TP388.BI "--margin=" MARGIN388.BI "\-\-margin=" MARGIN389Comma-separated expression for margins around the finder.390.br391392.br
13 unmodified lines
406.br407408.br409e.g.410 \fBfzf --margin 10%411 fzf --margin 1,5%\fR410 \fBfzf \-\-margin 10%411 fzf \-\-margin 1,5%\fR412.RE413.TP414.BI "--padding=" PADDING414.BI "\-\-padding=" PADDING415Comma-separated expression for padding inside the border. Padding is416distinguishable from margin only when \fB--border\fR option is used.416distinguishable from margin only when \fB\-\-border\fR option is used.417.br418419.br420e.g.421 \fBfzf --margin 5% --padding 5% --border --preview 'cat {}' \\422 --color bg:#222222,preview-bg:#333333\fR421 \fBfzf \-\-margin 5% \-\-padding 5% \-\-border \-\-preview 'cat {}' \\422 \-\-color bg:#222222,preview\-bg:#333333\fR423424.br425.RS426.BR TRBL " Same padding for top, right, bottom, and left"
6 unmodified lines
433.br434.RE435436.TP437.BI "--info=" "STYLE"437.BI "\-\-info=" "STYLE"438Determines the display style of the finder info. (e.g. match counter, loading indicator, etc.)439440.BR default " On the left end of the horizontal separator"440.BR default " On the left end of the horizontal separator"441.br442.BR right " On the right end of the horizontal separator"442.BR right " On the right end of the horizontal separator"443.br444.BR hidden " Do not display finder info"444.BR hidden " Do not display finder info"445.br446.BR inline " After the prompt with the default prefix ' < '"446.BR inline " After the prompt with the default prefix ' < '"447.br448.BR inline:PREFIX " After the prompt with a non-default prefix"448.BR inline:PREFIX " After the prompt with a non-default prefix"449.br450.BR inline-right " On the right end of the prompt line"450.BR inline\-right " On the right end of the prompt line"451.br452.BR inline-right:PREFIX " On the right end of the prompt line with a custom prefix"452.BR inline\-right:PREFIX " On the right end of the prompt line with a custom prefix"453.br454455.TP456.BI "--info-command=" "COMMAND"456.BI "\-\-info\-command=" "COMMAND"457Command to generate the finder info line. The command runs synchronously and458blocks the UI until completion, so make sure that it's fast. ANSI color codes459are supported. \fB$FZF_INFO\fR variable is set to the original info text.460For additional environment variables available to the command, see the section461ENVIRONMENT VARIABLES EXPORTED TO CHILD PROCESSES.462463e.g.464 \fB# Prepend the current cursor position in yellow465 fzf --info-command='echo -e "\\x1b[33;1m$FZF_POS\\x1b[m/$FZF_INFO 💛"'\fR465 fzf \-\-info\-command='echo \-e "\\x1b[33;1m$FZF_POS\\x1b[m/$FZF_INFO 💛"'\fR466467.TP468.B "--no-info"469A synonym for \fB--info=hidden\fB468.B "\-\-no\-info"469A synonym for \fB\-\-info=hidden\fB470471.TP472.BI "--separator=" "STR"472.BI "\-\-separator=" "STR"473The given string will be repeated to form the horizontal separator on the info474line (default: '─' or '-' depending on \fB--no-unicode\fR).474line (default: '─' or '\-' depending on \fB\-\-no\-unicode\fR).475476ANSI color codes are supported.477478.TP479.B "--no-separator"479.B "\-\-no\-separator"480Do not display horizontal separator on the info line. A synonym for481\fB--separator=''\fB481\fB\-\-separator=''\fB482483.TP484.BI "--scrollbar=" "CHAR1[CHAR2]"484.BI "\-\-scrollbar=" "CHAR1[CHAR2]"485Use the given character to render scrollbar. (default: '│' or ':' depending on486\fB--no-unicode\fR). The optional \fBCHAR2\fR is used to render scrollbar of486\fB\-\-no\-unicode\fR). The optional \fBCHAR2\fR is used to render scrollbar of487the preview window.488489.TP490.B "--no-scrollbar"491Do not display scrollbar. A synonym for \fB--scrollbar=''\fB490.B "\-\-no\-scrollbar"491Do not display scrollbar. A synonym for \fB\-\-scrollbar=''\fB492493.TP494.BI "--prompt=" "STR"494.BI "\-\-prompt=" "STR"495Input prompt (default: '> ')496.TP497.BI "--pointer=" "STR"498Pointer to the current line (default: '▌' or '>' depending on \fB--no-unicode\fR)497.BI "\-\-pointer=" "STR"498Pointer to the current line (default: '▌' or '>' depending on \fB\-\-no\-unicode\fR)499.TP500.BI "--marker=" "STR"501Multi-select marker (default: '┃' or '>' depending on \fB--no-unicode\fR)500.BI "\-\-marker=" "STR"501Multi-select marker (default: '┃' or '>' depending on \fB\-\-no\-unicode\fR)502.TP503.BI "--marker-multi-line=" "STR"503.BI "\-\-marker\-multi\-line=" "STR"504Multi-select marker for multi-line entries. 3 elements for top, middle, and bottom.505(default: '╻┃╹' or '.|'' depending on \fB--no-unicode\fR)505(default: '╻┃╹' or '.|'' depending on \fB\-\-no\-unicode\fR)506.TP507.BI "--header=" "STR"507.BI "\-\-header=" "STR"508The given string will be printed as the sticky header. The lines are displayed509in the given order from top to bottom regardless of \fB--layout\fR option, and510are not affected by \fB--with-nth\fR. ANSI color codes are processed even when511\fB--ansi\fR is not set.509in the given order from top to bottom regardless of \fB\-\-layout\fR option, and510are not affected by \fB\-\-with\-nth\fR. ANSI color codes are processed even when511\fB\-\-ansi\fR is not set.512.TP513.BI "--header-lines=" "N"513.BI "\-\-header\-lines=" "N"514The first N lines of the input are treated as the sticky header. When515\fB--with-nth\fR is set, the lines are transformed just like the other515\fB\-\-with\-nth\fR is set, the lines are transformed just like the other516lines that follow.517.TP518.B "--header-first"518.B "\-\-header\-first"519Print header before the prompt line520.TP521.BI "--ellipsis=" "STR"521.BI "\-\-ellipsis=" "STR"522Ellipsis to show when line is truncated (default: '..')523.SS Display524.TP525.B "--ansi"525.B "\-\-ansi"526Enable processing of ANSI color codes527.TP528.BI "--tabstop=" SPACES528.BI "\-\-tabstop=" SPACES529Number of spaces for a tab character (default: 8)530.TP531.BI "--color=" "[BASE_SCHEME][,COLOR_NAME[:ANSI_COLOR][:ANSI_ATTRIBUTES]]..."531.BI "\-\-color=" "[BASE_SCHEME][,COLOR_NAME[:ANSI_COLOR][:ANSI_ATTRIBUTES]]..."532Color configuration. The name of the base color scheme is followed by custom533color mappings.534535.RS
2 unmodified lines
538539 \fBdark \fRColor scheme for dark 256-color terminal540 \fBlight \fRColor scheme for light 256-color terminal541 \fB16 \fRColor scheme for 16-color terminal542 \fBbw \fRNo colors (equivalent to \fB--no-color\fR)542 \fBbw \fRNo colors (equivalent to \fB\-\-no\-color\fR)543544.B COLOR NAMES:545 \fBfg \fRText546 \fBselected-fg \fRSelected line text547 \fBpreview-fg \fRPreview window text546 \fBselected\-fg \fRSelected line text547 \fBpreview\-fg \fRPreview window text548 \fBbg \fRBackground549 \fBselected-bg \fRSelected line background550 \fBpreview-bg \fRPreview window background549 \fBselected\-bg \fRSelected line background550 \fBpreview\-bg \fRPreview window background551 \fBhl \fRHighlighted substrings552 \fBselected-hl \fRHighlighted substrings in the selected line553 \fBcurrent-fg (fg+) \fRText (current line)554 \fBcurrent-bg (bg+) \fRBackground (current line)552 \fBselected\-hl \fRHighlighted substrings in the selected line553 \fBcurrent\-fg (fg+) \fRText (current line)554 \fBcurrent\-bg (bg+) \fRBackground (current line)555 \fBgutter \fRGutter on the left556 \fBcurrent-hl (hl+) \fRHighlighted substrings (current line)556 \fBcurrent\-hl (hl+) \fRHighlighted substrings (current line)557 \fBquery \fRQuery string558 \fBdisabled \fRQuery string when search is disabled (\fB--disabled\fR)558 \fBdisabled \fRQuery string when search is disabled (\fB\-\-disabled\fR)559 \fBinfo \fRInfo line (match counters)560 \fBborder \fRBorder around the window (\fB--border\fR and \fB--preview\fR)560 \fBborder \fRBorder around the window (\fB\-\-border\fR and \fB\-\-preview\fR)561 \fBscrollbar \fRScrollbar562 \fBpreview-border \fRBorder around the preview window (\fB--preview\fR)563 \fBpreview-scrollbar \fRScrollbar562 \fBpreview\-border \fRBorder around the preview window (\fB\-\-preview\fR)563 \fBpreview\-scrollbar \fRScrollbar564 \fBseparator \fRHorizontal separator on info line565 \fBlabel \fRBorder label (\fB--border-label\fR and \fB--preview-label\fR)566 \fBpreview-label \fRBorder label of the preview window (\fB--preview-label\fR)565 \fBlabel \fRBorder label (\fB\-\-border\-label\fR and \fB\-\-preview\-label\fR)566 \fBpreview\-label \fRBorder label of the preview window (\fB\-\-preview\-label\fR)567 \fBprompt \fRPrompt568 \fBpointer \fRPointer to the current line569 \fBmarker \fRMulti-select marker569 \fBmarker \fRMulti\-select marker570 \fBspinner \fRStreaming input indicator571 \fBheader \fRHeader572573.B ANSI COLORS:574 \fB-1 \fRDefault terminal foreground/background color574 \fB\-1 \fRDefault terminal foreground/background color575 \fB \fR(or the original color of the text)576 \fB0 ~ 15 \fR16 base colors577 \fBblack\fR578 \fBred\fR
2 unmodified lines
581 \fBblue\fR582 \fBmagenta\fR583 \fBcyan\fR584 \fBwhite\fR585 \fBbright-black\fR (gray | grey)586 \fBbright-red\fR587 \fBbright-green\fR588 \fBbright-yellow\fR589 \fBbright-blue\fR590 \fBbright-magenta\fR591 \fBbright-cyan\fR592 \fBbright-white\fR585 \fBbright\-black\fR (gray | grey)586 \fBbright\-red\fR587 \fBbright\-green\fR588 \fBbright\-yellow\fR589 \fBbright\-blue\fR590 \fBbright\-magenta\fR591 \fBbright\-cyan\fR592 \fBbright\-white\fR593 \fB16 ~ 255 \fRANSI 256 colors594 \fB#rrggbb \fR24-bit colors595596.B ANSI ATTRIBUTES: (Only applies to foreground colors)
8 unmodified lines
605.B EXAMPLES:606607 \fB# Seoul256 theme with 8-bit colors608 # (https://github.com/junegunn/seoul256.vim)609 fzf --color='bg:237,bg+:236,info:143,border:240,spinner:108' \\610 --color='hl:65,fg:252,header:65,fg+:252' \\611 --color='pointer:161,marker:168,prompt:110,hl+:108'609 fzf \-\-color='bg:237,bg+:236,info:143,border:240,spinner:108' \\610 \-\-color='hl:65,fg:252,header:65,fg+:252' \\611 \-\-color='pointer:161,marker:168,prompt:110,hl+:108'612613 # Seoul256 theme with 24-bit colors614 fzf --color='bg:#4B4B4B,bg+:#3F3F3F,info:#BDBB72,border:#6B6B6B,spinner:#98BC99' \\615 --color='hl:#719872,fg:#D9D9D9,header:#719872,fg+:#D9D9D9' \\616 --color='pointer:#E12672,marker:#E17899,prompt:#98BEDE,hl+:#98BC99'\fR614 fzf \-\-color='bg:#4B4B4B,bg+:#3F3F3F,info:#BDBB72,border:#6B6B6B,spinner:#98BC99' \\615 \-\-color='hl:#719872,fg:#D9D9D9,header:#719872,fg+:#D9D9D9' \\616 \-\-color='pointer:#E12672,marker:#E17899,prompt:#98BEDE,hl+:#98BC99'\fR617.RE618.TP619.B "--highlight-line"619.B "\-\-highlight\-line"620Highlight the whole current line621.TP622.B "--no-bold"622.B "\-\-no\-bold"623Do not use bold text624.TP625.B "--black"625.B "\-\-black"626Use black background627.SS History628.TP629.BI "--history=" "HISTORY_FILE"629.BI "\-\-history=" "HISTORY_FILE"630Load search history from the specified file and update the file on completion.631When enabled, \fBCTRL-N\fR and \fBCTRL-P\fR are automatically remapped to632\fBnext-history\fR and \fBprev-history\fR.631When enabled, \fBCTRL\-N\fR and \fBCTRL\-P\fR are automatically remapped to632\fBnext\-history\fR and \fBprev\-history\fR.633.TP634.BI "--history-size=" "N"634.BI "\-\-history\-size=" "N"635Maximum number of entries in the history file (default: 1000). The file is636automatically truncated when the number of the lines exceeds the value.637.SS Preview638.TP639.BI "--preview=" "COMMAND"639.BI "\-\-preview=" "COMMAND"640Execute the given command for the current line and display the result on the641preview window. \fB{}\fR in the command is the placeholder that is replaced to642the single-quoted string of the current line. To transform the replacement643string, specify field index expressions between the braces (See \fBFIELD INDEX644EXPRESSION\fR for the details).645646.RS647e.g.648 \fBfzf --preview='head -$LINES {}'649 ls -l | fzf --preview="echo user={3} when={-4..-2}; cat {-1}" --header-lines=1\fR648 \fBfzf \-\-preview='head \-$LINES {}'649 ls \-l | fzf \-\-preview="echo user={3} when={\-4..\-2}; cat {\-1}" \-\-header\-lines=1\fR650651fzf exports \fB$FZF_PREVIEW_LINES\fR and \fB$FZF_PREVIEW_COLUMNS\fR so that652they represent the exact size of the preview window. (It also overrides653\fB$LINES\fR and \fB$COLUMNS\fR with the same values but they can be reset
7 unmodified lines
661space-separated list of the selected lines (or the current line if no selection662was made) individually quoted.663664e.g.665 \fBfzf --multi --preview='head -10 {+}'666 git log --oneline | fzf --multi --preview 'git show {+1}'\fR665 \fBfzf \-\-multi \-\-preview='head \-10 {+}'666 git log \-\-oneline | fzf \-\-multi \-\-preview 'git show {+1}'\fR667668When using a field index expression, leading and trailing whitespace is stripped669from the replacement string. To preserve the whitespace, use the \fBs\fR flag.670
2 unmodified lines
673multi-select a large number of items and the length of the evaluated string may674exceed \fBARG_MAX\fR.675676e.g.677 \fB# Press CTRL-A to select 100K items and see the sum of all the numbers.677 \fB# Press CTRL\-A to select 100K items and see the sum of all the numbers.678 # This won't work properly without 'f' flag due to ARG_MAX limit.679 seq 100000 | fzf --multi --bind ctrl-a:select-all \\680 --preview "awk '{sum+=\\$1} END {print sum}' {+f}"\fR679 seq 100000 | fzf \-\-multi \-\-bind ctrl\-a:select\-all \\680 \-\-preview "awk '{sum+=\\$1} END {print sum}' {+f}"\fR681682Also,683684* \fB{q}\fR is replaced to the current query string
13 unmodified lines
698supported, so you can use it to implement preview window that is constantly699updating.700701e.g.702 \fBfzf --preview 'for i in $(seq 100000); do702 \fBfzf \-\-preview 'for i in $(seq 100000); do703 (( i % 200 == 0 )) && printf "\\033[2J"704 echo "$i"705 sleep 0.01706 done'\fR707708fzf has experimental support for Kitty graphics protocol and Sixel graphics.709The following example uses https://github.com/junegunn/fzf/blob/master/bin/fzf-preview.sh709The following example uses https://github.com/junegunn/fzf/blob/master/bin/fzf\-preview.sh710script to render an image using either of the protocols inside the preview window.711712e.g.713 \fBfzf --preview='fzf-preview.sh {}'\fR713 \fBfzf \-\-preview='fzf\-preview.sh {}'\fR714715.RE716717.TP718.BI "--preview-label" [=LABEL]718.BI "\-\-preview\-label" [=LABEL]719Label to print on the horizontal border line of the preview window.720Should be used with one of the following \fB--preview-window\fR options.720Should be used with one of the following \fB\-\-preview\-window\fR options.721722.br723.B * border-rounded (default on non-Windows platforms)723.B * border\-rounded (default on non-Windows platforms)724.br725.B * border-sharp (default on Windows)725.B * border\-sharp (default on Windows)726.br727.B * border-bold727.B * border\-bold728.br729.B * border-double729.B * border\-double730.br731.B * border-block731.B * border\-block732.br733.B * border-thinblock733.B * border\-thinblock734.br735.B * border-horizontal735.B * border\-horizontal736.br737.B * border-top737.B * border\-top738.br739.B * border-bottom739.B * border\-bottom740.br741742.TP743.BI "--preview-label-pos" [=N[:top|bottom]]743.BI "\-\-preview\-label\-pos" [=N[:top|bottom]]744Position of the border label on the border line of the preview window. Specify745a positive integer as the column position from the left. Specify a negative746integer to right-align the label. Label is printed on the top border line by747default, add \fB:bottom\fR to put it on the border line on the bottom. The748default value 0 (or \fBcenter\fR) will put the label at the center of the749border line.750751.TP752.BI "--preview-window=" "[POSITION][,SIZE[%]][,border-BORDER_OPT][,[no]wrap][,[no]follow][,[no]cycle][,[no]hidden][,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES][,default][,<SIZE_THRESHOLD(ALTERNATIVE_LAYOUT)]"752.BI "\-\-preview\-window=" "[POSITION][,SIZE[%]][,border\-BORDER_OPT][,[no]wrap][,[no]follow][,[no]cycle][,[no]hidden][,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES][,default][,<SIZE_THRESHOLD(ALTERNATIVE_LAYOUT)]"753754.RS755.B POSITION: (default: right)756 \fBup
3 unmodified lines
760761\fRDetermines the layout of the preview window.762763* If the argument contains \fB:hidden\fR, the preview window will be hidden by764default until \fBtoggle-preview\fR action is triggered.764default until \fBtoggle\-preview\fR action is triggered.765766* If size is given as 0, preview window will not be visible, but fzf will still767execute the command in the background.768769* Long lines are truncated by default. Line wrap can be enabled with770\fBwrap\fR flag.771772* Preview window will automatically scroll to the bottom when \fBfollow\fR773flag is set, similarly to how \fBtail -f\fR works.773flag is set, similarly to how \fBtail \-f\fR works.774775.RS776e.g.777 \fBfzf --preview-window follow --preview 'for i in $(seq 100000); do777 \fBfzf \-\-preview\-window follow \-\-preview 'for i in $(seq 100000); do778 echo "$i"779 sleep 0.01780 (( i % 300 == 0 )) && printf "\\033[2J"781 done'\fR
1 unmodified line
783784* Cyclic scrolling is enabled with \fBcycle\fR flag.785786* To change the style of the border of the preview window, specify one of787the options for \fB--border\fR with \fBborder-\fR prefix.788e.g. \fBborder-rounded\fR (border with rounded edges, default),789\fBborder-sharp\fR (border with sharp edges), \fBborder-left\fR,790\fBborder-none\fR, etc.787the options for \fB\-\-border\fR with \fBborder\-\fR prefix.788e.g. \fBborder\-rounded\fR (border with rounded edges, default),789\fBborder\-sharp\fR (border with sharp edges), \fBborder\-left\fR,790\fBborder\-none\fR, etc.791792* \fB[:+SCROLL[OFFSETS][/DENOM]]\fR determines the initial scroll offset of the793preview window.794795 - \fBSCROLL\fR can be either a numeric integer or a single-field index expression that refers to a numeric integer.796797 - 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).797 - 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).798799 - The final \fB/DENOM\fR part is for specifying a fraction of the preview window height.800801* \fB~HEADER_LINES\fR keeps the top N lines as the fixed header so that they
3 unmodified lines
805806.RS807e.g.808 \fB# Non-default scroll window positions and sizes809 fzf --preview="head {}" --preview-window=up,30%810 fzf --preview="file {}" --preview-window=down,1809 fzf \-\-preview="head {}" \-\-preview\-window=up,30%810 fzf \-\-preview="file {}" \-\-preview\-window=down,1811812 # Initial scroll offset is set to the line number of each line of813 # git grep output *minus* 5 lines (-5)814 git grep --line-number '' |815 fzf --delimiter : --preview 'nl {1}' --preview-window '+{2}-5'813 # git grep output *minus* 5 lines (\-5)814 git grep \-\-line\-number '' |815 fzf \-\-delimiter : \-\-preview 'nl {1}' \-\-preview\-window '+{2}\-5'816817 # Preview with bat, matching line in the middle of the window below818 # the fixed header of the top 3 lines819 #
1 unmodified line
821 # +{2} Base scroll offset extracted from the second field822 # +3 Extra offset to compensate for the 3-line header823 # /2 Put in the middle of the preview area824 #825 git grep --line-number '' |826 fzf --delimiter : \\827 --preview 'bat --style=full --color=always --highlight-line {2} {1}' \\828 --preview-window '~3,+{2}+3/2'825 git grep \-\-line\-number '' |826 fzf \-\-delimiter : \\827 \-\-preview 'bat \-\-style=full \-\-color=always \-\-highlight\-line {2} {1}' \\828 \-\-preview\-window '~3,+{2}+3/2'829830 # Display top 3 lines as the fixed header831 fzf --preview 'bat --style=full --color=always {}' --preview-window '~3'\fR831 fzf \-\-preview 'bat \-\-style=full \-\-color=always {}' \-\-preview\-window '~3'\fR832.RE833834* You can specify an alternative set of options that are used only when the size835 of the preview window is below a certain threshold. Note that only one836 alternative layout is allowed.837838.RS839e.g.840 \fBfzf --preview 'cat {}' --preview-window 'right,border-left,<30(up,30%,border-bottom)'\fR840 \fBfzf \-\-preview 'cat {}' \-\-preview\-window 'right,border\-left,<30(up,30%,border\-bottom)'\fR841.RE842843.SS Scripting844.TP845.BI "-q, --query=" "STR"845.BI "\-q, \-\-query=" "STR"846Start the finder with the given query847.TP848.B "-1, --select-1"849If there is only one match for the initial query (\fB--query\fR), do not start848.B "\-1, \-\-select\-1"849If there is only one match for the initial query (\fB\-\-query\fR), do not start850interactive finder and automatically select the only match851.TP852.B "-0, --exit-0"853If there is no match for the initial query (\fB--query\fR), do not start852.B "\-0, \-\-exit\-0"853If there is no match for the initial query (\fB\-\-query\fR), do not start854interactive finder and exit immediately855.TP856.BI "-f, --filter=" "STR"857Filter mode. Do not start interactive finder. When used with \fB--no-sort\fR,856.BI "\-f, \-\-filter=" "STR"857Filter mode. Do not start interactive finder. When used with \fB\-\-no\-sort\fR,858fzf becomes a fuzzy-version of grep.859.TP860.B "--print-query"860.B "\-\-print\-query"861Print query as the first line862.TP863.BI "--expect=" "KEY[,..]"863.BI "\-\-expect=" "KEY[,..]"864Comma-separated list of keys that can be used to complete fzf in addition to865the default enter key. When this option is set, fzf will print the name of the866key pressed as the first line of its output (or as the second line if867\fB--print-query\fR is also used). The line will be empty if fzf is completed868with the default enter key. If \fB--expect\fR option is specified multiple869times, fzf will expect the union of the keys. \fB--no-expect\fR will clear the867\fB\-\-print\-query\fR is also used). The line will be empty if fzf is completed868with the default enter key. If \fB\-\-expect\fR option is specified multiple869times, fzf will expect the union of the keys. \fB\-\-no\-expect\fR will clear the870list.871872.RS873e.g.874 \fBfzf --expect=ctrl-v,ctrl-t,alt-s --expect=f1,f2,~,@\fR874 \fBfzf \-\-expect=ctrl\-v,ctrl\-t,alt\-s \-\-expect=f1,f2,~,@\fR875.RE876877This option is not compatible with \fB--bind\fR on the same key and will take877This option is not compatible with \fB\-\-bind\fR on the same key and will take878precedence over it. To combine the two, use \fBprint\fR action.879880.RS881e.g.882 \fBfzf --multi --bind 'enter:print()+accept,ctrl-y:select-all+print(ctrl-y)+accept'\fR882 \fBfzf \-\-multi \-\-bind 'enter:print()+accept,ctrl\-y:select\-all+print(ctrl\-y)+accept'\fR883.RE884.TP885.B "--read0"885.B "\-\-read0"886Read input delimited by ASCII NUL characters instead of newline characters887.TP888.B "--print0"888.B "\-\-print0"889Print output delimited by ASCII NUL characters instead of newline characters890.TP891.B "--no-clear"891.B "\-\-no\-clear"892Do not clear finder interface on exit. If fzf was started in full screen mode,893it will not switch back to the original screen, so you'll have to manually run894\fBtput rmcup\fR to return. This option can be used to avoid flickering of the895screen when your application needs to start fzf multiple times in order. (Note896that in most cases, it is preferable to use \fBreload\fR action instead.)897898e.g.899 \fBfoo=$(seq 100 | fzf --no-clear) || (899 \fBfoo=$(seq 100 | fzf \-\-no\-clear) || (900 # Need to manually switch back to the main screen when cancelled901 tput rmcup902 exit 1903 ) && seq "$foo" 100 | fzf904905.TP906.B "--sync"906.B "\-\-sync"907Synchronous search for multi-staged filtering. If specified, fzf will launch908the finder only after the input stream is complete and the initial filtering909and the associated actions (bound to any of \fBstart\fR, \fBload\fR,910\fBresult\fR, or \fBfocus\fR) are complete.911912.RS913e.g. \fB# Avoid rendering both fzf instances at the same time914 fzf --multi | fzf --sync914 fzf \-\-multi | fzf \-\-sync915916 # fzf will not render intermediate states917 (sleep 1; seq 1000000; sleep 1) |918 fzf --sync --query 5 --listen --bind start:up,load:up,result:up,focus:change-header:Ready\fR918 fzf \-\-sync \-\-query 5 \-\-listen \-\-bind start:up,load:up,result:up,focus:change\-header:Ready\fR919.RE920.TP921.B "--with-shell=STR"921.B "\-\-with\-shell=STR"922Shell command and flags to start child processes with. On *nix Systems, the923default value is \fB$SHELL -c\fR if \fB$SHELL\fR is set, otherwise \fBsh -c\fR.923default value is \fB$SHELL \-c\fR if \fB$SHELL\fR is set, otherwise \fBsh \-c\fR.924On Windows, the default value is \fBcmd /s/c\fR when \fB$SHELL\fR is not925set.926927.RS928e.g. \fBgem list | fzf --with-shell 'ruby -e' --preview 'pp Gem::Specification.find_by_name({1})'\fR928e.g. \fBgem list | fzf \-\-with\-shell 'ruby \-e' \-\-preview 'pp Gem::Specification.find_by_name({1})'\fR929.RE930.TP931.B "--listen[=[ADDR:]PORT]" "--listen-unsafe[=[ADDR:]PORT]"931.B "\-\-listen[=[ADDR:]PORT]" "\-\-listen\-unsafe[=[ADDR:]PORT]"932Start HTTP server and listen on the given address. It allows external processes933to send actions to perform via POST method.934935- If the port number is omitted or given as 0, fzf will automatically choose936a port and export it as \fBFZF_PORT\fR environment variable to the child processes937938- If \fBFZF_API_KEY\fR environment variable is set, the server would require939sending an API key with the same value in the \fBx-api-key\fR HTTP header939sending an API key with the same value in the \fBx\-api\-key\fR HTTP header940941- \fBFZF_API_KEY\fR is required for a non-localhost listen address942943- To allow remote process execution, use \fB--listen-unsafe\fR943- To allow remote process execution, use \fB\-\-listen\-unsafe\fR944945e.g.946 \fB# Start HTTP server on port 6266947 fzf --listen 6266947 fzf \-\-listen 6266948949 # Send action to the server950 curl -XPOST localhost:6266 -d 'reload(seq 100)+change-prompt(hundred> )'950 curl \-XPOST localhost:6266 \-d 'reload(seq 100)+change\-prompt(hundred> )'951952 # Get program state in JSON format (experimental)953 # * Make sure NOT to access this endpoint from execute/transform actions954 # as it will result in a timeout955 curl localhost:6266956957 # Start HTTP server on port 6266 with remote connections allowed958 # * Listening on non-localhost address requires using an API key959 export FZF_API_KEY="$(head -c 32 /dev/urandom | base64)"960 fzf --listen 0.0.0.0:6266959 export FZF_API_KEY="$(head \-c 32 /dev/urandom | base64)"960 fzf \-\-listen 0.0.0.0:6266961962 # Send an authenticated action963 curl -XPOST localhost:6266 -H "x-api-key: $FZF_API_KEY" -d 'change-query(yo)'963 curl \-XPOST localhost:6266 \-H "x\-api\-key: $FZF_API_KEY" \-d 'change\-query(yo)'964965 # Choose port automatically and export it as $FZF_PORT to the child process966 fzf --listen --bind 'start:execute-silent:echo $FZF_PORT > /tmp/fzf-port'966 fzf \-\-listen \-\-bind 'start:execute\-silent:echo $FZF_PORT > /tmp/fzf\-port'967 \fR968.SS Help969.TP970.B "--version"970.B "\-\-version"971Display version information and exit972.TP973.B "--help"973.B "\-\-help"974Show help message975.TP976.B "--man"976.B "\-\-man"977Show man page978979.SS Directory traversal980.TP981.B "--walker=[file][,dir][,follow][,hidden]"981.B "\-\-walker=[file][,dir][,follow][,hidden]"982Determines the behavior of the built-in directory walker that is used when983\fB$FZF_DEFAULT_COMMAND\fR is not set. The default value is \fBfile,follow,hidden\fR.984985* \fBfile\fR: Include files in the search result
5 unmodified lines
991* \fBfollow\fR: Follow symbolic links992.br993994.TP995.B "--walker-root=DIR"995.B "\-\-walker\-root=DIR"996The root directory from which to start the built-in directory walker.997The default value is the current working directory.998999.TP1000.B "--walker-skip=DIRS"1000.B "\-\-walker\-skip=DIRS"1001Comma-separated list of directory names to skip during the directory walk.1002The default value is \fB.git,node_modules\fR.10031004.SS Shell integration1005.TP1006.B "--bash"1006.B "\-\-bash"1007Print script to set up Bash shell integration10081009e.g. \fBeval "$(fzf --bash)"\fR1009e.g. \fBeval "$(fzf \-\-bash)"\fR10101011.TP1012.B "--zsh"1012.B "\-\-zsh"1013Print script to set up Zsh shell integration10141015e.g. \fBsource <(fzf --zsh)\fR1015e.g. \fBsource <(fzf \-\-zsh)\fR10161017.TP1018.B "--fish"1018.B "\-\-fish"1019Print script to set up Fish shell integration10201021e.g. \fBfzf --fish | source\fR1021e.g. \fBfzf \-\-fish | source\fR10221023.SH ENVIRONMENT VARIABLES1024.TP1025.B FZF_DEFAULT_COMMAND1026Default command to use when input is tty. On *nix systems, fzf runs the command1027with \fB$SHELL -c\fR if \fBSHELL\fR is set, otherwise with \fBsh -c\fR, so in1027with \fB$SHELL \-c\fR if \fBSHELL\fR is set, otherwise with \fBsh \-c\fR, so in1028this case make sure that the command is POSIX-compliant.1029.TP1030.B FZF_DEFAULT_OPTS1031Default options.1032.br1033e.g. \fBexport FZF_DEFAULT_OPTS="--layout=reverse --border --cycle"\fR1033e.g. \fBexport FZF_DEFAULT_OPTS="\-\-layout=reverse \-\-border \-\-cycle"\fR1034.TP1035.B FZF_DEFAULT_OPTS_FILE1036The location of the file that contains the default options.1037.br1038e.g. \fBexport FZF_DEFAULT_OPTS_FILE=~/.fzfrc\fR1039.TP1040.B FZF_API_KEY1041Can be used to require an API key when using \fB--listen\fR option. If not set,1041Can be used to require an API key when using \fB\-\-listen\fR option. If not set,1042no authentication will be required by the server. You can set this value if1043you need to protect against DNS rebinding and privilege escalation attacks.10441045.SH EXIT STATUS
6 unmodified lines
1052.BR 126 " Permission denied error from \fBbecome\fR action"1053.br1054.BR 127 " Invalid shell command for \fBbecome\fR action"1055.br1056.BR 130 " Interrupted with \fBCTRL-C\fR or \fBESC\fR"1056.BR 130 " Interrupted with \fBCTRL\-C\fR or \fBESC\fR"10571058.SH FIELD INDEX EXPRESSION10591060A field index expression can be a non-zero integer or a range expression1061([BEGIN]..[END]). \fB--nth\fR and \fB--with-nth\fR take a comma-separated list1061([BEGIN]..[END]). \fB\-\-nth\fR and \fB\-\-with\-nth\fR take a comma-separated list1062of field index expressions.10631064.SS Examples1065.BR 1 " The 1st field"1066.br1067.BR 2 " The 2nd field"1068.br1069.BR -1 " The last field"1069.BR \-1 " The last field"1070.br1071.BR -2 " The 2nd to last field"1071.BR \-2 " The 2nd to last field"1072.br1073.BR 3..5 " From the 3rd field to the 5th field"1074.br1075.BR 2.. " From the 2nd field to the last field"1076.br1077.BR ..-3 " From the 1st field to the 3rd to the last field"1077.BR ..\-3 " From the 1st field to the 3rd to the last field"1078.br1079.BR .. " All the fields"1080.br1081
24 unmodified lines
1106.BR FZF_ACTION " The name of the last action performed"1107.br1108.BR FZF_KEY " The name of the last key pressed"1109.br1110.BR FZF_PORT " Port number when --listen option is used"1110.BR FZF_PORT " Port number when \-\-listen option is used"1111.br11121113The following variables are additionally exported to the preview commands.1114
6 unmodified lines
1121.BR FZF_PREVIEW_COLUMNS " Number of columns in the preview window"11221123.SH EXTENDED SEARCH MODE11241125Unless specified otherwise, fzf will start in "extended-search mode". In this1125Unless specified otherwise, fzf will start in "extended\-search mode". In this1126mode, you can specify multiple patterns delimited by spaces, such as: \fB'wild1127^music .mp3$ sbtrkt !rmx\fR11281129You can prepend a backslash to a space (\fB\\ \fR) to match a literal space1130character.11311132.SS Exact-match (quoted)1132.SS Exact\-match (quoted)1133A term that is prefixed by a single-quote character (\fB'\fR) is interpreted as1134an "exact-match" (or "non-fuzzy") term. fzf will search for the exact1134an "exact\-match" (or "non\-fuzzy") term. fzf will search for the exact1135occurrences of the string.11361137.SS Anchored-match1137.SS Anchored\-match1138A term can be prefixed by \fB^\fR, or suffixed by \fB$\fR to become an1139anchored-match term. Then fzf will search for the lines that start with or end1140with the given string. An anchored-match term is also an exact-match term.11411142.SS Negation1143If a term is prefixed by \fB!\fR, fzf will exclude the lines that satisfy the1144term from the result. In this case, fzf performs exact match by default.11451146.SS Exact-match by default1146.SS Exact\-match by default1147If you don't prefer fuzzy matching and do not wish to "quote" (prefixing with1148\fB'\fR) every word, start fzf with \fB-e\fR or \fB--exact\fR option. Note that1149when \fB--exact\fR is set, \fB'\fR-prefix "unquotes" the term.1148\fB'\fR) every word, start fzf with \fB\-e\fR or \fB\-\-exact\fR option. Note that1149when \fB\-\-exact\fR is set, \fB'\fR\-prefix "unquotes" the term.11501151.SS OR operator1152A single bar character term acts as an OR operator. For example, the following1153query matches entries that start with \fBcore\fR and end with either \fBgo\fR,
1 unmodified line
11551156e.g. \fB^core go$ | rb$ | py$\fR11571158.SH KEY/EVENT BINDINGS1159\fB--bind\fR option allows you to bind \fBa key\fR or \fBan event\fR to one or1159\fB\-\-bind\fR option allows you to bind \fBa key\fR or \fBan event\fR to one or1160more \fBactions\fR. You can use it to customize key bindings or implement1161dynamic behaviors.11621163\fB--bind\fR takes a comma-separated list of binding expressions. Each binding1163\fB\-\-bind\fR takes a comma-separated list of binding expressions. Each binding1164expression is \fBKEY:ACTION\fR or \fBEVENT:ACTION\fR.11651166e.g.1167 \fBfzf --bind=ctrl-j:accept,ctrl-k:kill-line\fR1167 \fBfzf \-\-bind=ctrl\-j:accept,ctrl\-k:kill\-line\fR11681169.SS AVAILABLE KEYS: (SYNONYMS)1170\fIctrl-[a-z]\fR1170\fIctrl\-[a\-z]\fR1171.br1172\fIctrl-space\fR1172\fIctrl\-space\fR1173.br1174\fIctrl-delete\fR1174\fIctrl\-delete\fR1175.br1176\fIctrl-\\\fR1176\fIctrl\-\\\fR1177.br1178\fIctrl-]\fR1178\fIctrl\-]\fR1179.br1180\fIctrl-^\fR (\fIctrl-6\fR)1180\fIctrl\-^\fR (\fIctrl\-6\fR)1181.br1182\fIctrl-/\fR (\fIctrl-_\fR)1182\fIctrl\-/\fR (\fIctrl\-_\fR)1183.br1184\fIctrl-alt-[a-z]\fR1184\fIctrl\-alt\-[a\-z]\fR1185.br1186\fIalt-[*]\fR (Any case-sensitive single character is allowed)1186\fIalt\-[*]\fR (Any case-sensitive single character is allowed)1187.br1188\fIf[1-12]\fR1188\fIf[1\-12]\fR1189.br1190\fIenter\fR (\fIreturn\fR \fIctrl-m\fR)1190\fIenter\fR (\fIreturn\fR \fIctrl\-m\fR)1191.br1192\fIspace\fR1193.br1194\fIbackspace\fR (\fIbspace\fR \fIbs\fR)1195.br1196\fIalt-up\fR1196\fIalt\-up\fR1197.br1198\fIalt-down\fR1198\fIalt\-down\fR1199.br1200\fIalt-left\fR1200\fIalt\-left\fR1201.br1202\fIalt-right\fR1202\fIalt\-right\fR1203.br1204\fIalt-enter\fR1204\fIalt\-enter\fR1205.br1206\fIalt-space\fR1206\fIalt\-space\fR1207.br1208\fIalt-backspace\fR (\fIalt-bspace\fR \fIalt-bs\fR)1208\fIalt\-backspace\fR (\fIalt\-bspace\fR \fIalt\-bs\fR)1209.br1210\fItab\fR1211.br1212\fIshift-tab\fR (\fIbtab\fR)1212\fIshift\-tab\fR (\fIbtab\fR)1213.br1214\fIesc\fR1215.br1216\fIdelete\fR (\fIdel\fR)
11 unmodified lines
1228\fIend\fR1229.br1230\fIinsert\fR1231.br1232\fIpage-up\fR (\fIpgup\fR)1232\fIpage\-up\fR (\fIpgup\fR)1233.br1234\fIpage-down\fR (\fIpgdn\fR)1234\fIpage\-down\fR (\fIpgdn\fR)1235.br1236\fIshift-up\fR1236\fIshift\-up\fR1237.br1238\fIshift-down\fR1238\fIshift\-down\fR1239.br1240\fIshift-left\fR1240\fIshift\-left\fR1241.br1242\fIshift-right\fR1242\fIshift\-right\fR1243.br1244\fIshift-delete\fR1244\fIshift\-delete\fR1245.br1246\fIalt-shift-up\fR1246\fIalt\-shift\-up\fR1247.br1248\fIalt-shift-down\fR1248\fIalt\-shift\-down\fR1249.br1250\fIalt-shift-left\fR1250\fIalt\-shift\-left\fR1251.br1252\fIalt-shift-right\fR1252\fIalt\-shift\-right\fR1253.br1254\fIleft-click\fR1254\fIleft\-click\fR1255.br1256\fIright-click\fR1256\fIright\-click\fR1257.br1258\fIdouble-click\fR1258\fIdouble\-click\fR1259.br1260\fIscroll-up\fR1260\fIscroll\-up\fR1261.br1262\fIscroll-down\fR1262\fIscroll\-down\fR1263.br1264\fIpreview-scroll-up\fR1264\fIpreview\-scroll\-up\fR1265.br1266\fIpreview-scroll-down\fR1266\fIpreview\-scroll\-down\fR1267.br1268\fIshift-left-click\fR1268\fIshift\-left\-click\fR1269.br1270\fIshift-right-click\fR1270\fIshift\-right\-click\fR1271.br1272\fIshift-scroll-up\fR1272\fIshift\-scroll\-up\fR1273.br1274\fIshift-scroll-down\fR1274\fIshift\-scroll\-down\fR1275.br1276or any single character12771278.SS AVAILABLE EVENTS:1279\fIstart\fR1280.RS1281Triggered only once when fzf finder starts. Since fzf consumes the input stream1282asynchronously, the input list is not available unless you use \fI--sync\fR.1282asynchronously, the input list is not available unless you use \fI\-\-sync\fR.12831284e.g.1285 \fB# Move cursor to the last item and select all items1286 seq 1000 | fzf --multi --sync --bind start:last+select-all\fR1286 seq 1000 | fzf \-\-multi \-\-sync \-\-bind start:last+select\-all\fR1287.RE12881289\fIload\fR1290.RS
1 unmodified line
1292list is complete.12931294e.g.1295 \fB# Change the prompt to "loaded" when the input stream is complete1296 (seq 10; sleep 1; seq 11 20) | fzf --prompt 'Loading> ' --bind 'load:change-prompt:Loaded> '\fR1296 (seq 10; sleep 1; seq 11 20) | fzf \-\-prompt 'Loading> ' \-\-bind 'load:change\-prompt:Loaded> '\fR1297.RE12981299\fIresize\fR1300.RS1301Triggered when the terminal size is changed.13021303e.g.1304 \fBfzf --bind 'resize:transform-header:echo Resized: ${FZF_COLUMNS}x${FZF_LINES}'\fR1304 \fBfzf \-\-bind 'resize:transform\-header:echo Resized: ${FZF_COLUMNS}x${FZF_LINES}'\fR1305.RE13061307\fIresult\fR1308.RS
1 unmodified line
13101311e.g.1312 \fB# Put the cursor on the second item when the query string is empty1313 # * Note that you can't use 'change' event in this case because the second position may not be available1314 fzf --sync --bind 'result:transform:[[ -z {q} ]] && echo "pos(2)"'\fR1314 fzf \-\-sync \-\-bind 'result:transform:[[ \-z {q} ]] && echo "pos(2)"'\fR1315.RE1316\fIchange\fR1317.RS1318Triggered whenever the query string is changed13191320e.g.1321 \fB# Move cursor to the first entry whenever the query is changed1322 fzf --bind change:first\fR1322 fzf \-\-bind change:first\fR1323.RE1324\fIfocus\fR1325.RS1326Triggered when the focus changes due to a vertical cursor movement or a search1327result update.13281329e.g.1330 \fBfzf --bind 'focus:transform-preview-label:echo [ {} ]' --preview 'cat {}'1330 \fBfzf \-\-bind 'focus:transform\-preview\-label:echo [ {} ]' \-\-preview 'cat {}'13311332 # Any action bound to the event runs synchronously and thus can make the interface sluggish1333 # e.g. lolcat isn't one of the fastest programs, and every cursor movement in1334 # fzf will be noticeably affected by its execution time1335 fzf --bind 'focus:transform-preview-label:echo [ {} ] | lolcat -f' --preview 'cat {}'1335 fzf \-\-bind 'focus:transform\-preview\-label:echo [ {} ] | lolcat \-f' \-\-preview 'cat {}'13361337 # Beware not to introduce an infinite loop1338 seq 10 | fzf --bind 'focus:up' --cycle\fR1338 seq 10 | fzf \-\-bind 'focus:up' \-\-cycle\fR1339.RE13401341\fIone\fR1342.RS1343Triggered when there's only one match. \fBone:accept\fR binding is comparable1344to \fB--select-1\fR option, but the difference is that \fB--select-1\fR is only1344to \fB\-\-select\-1\fR option, but the difference is that \fB\-\-select\-1\fR is only1345effective before the interactive finder starts but \fBone\fR event is triggered1346by the interactive finder.13471348e.g.1349 \fB# Automatically select the only match1350 seq 10 | fzf --bind one:accept\fR1350 seq 10 | fzf \-\-bind one:accept\fR1351.RE13521353\fIzero\fR1354.RS1355Triggered when there's no match. \fBzero:abort\fR binding is comparable to1356\fB--exit-0\fR option, but the difference is that \fB--exit-0\fR is only1356\fB\-\-exit\-0\fR option, but the difference is that \fB\-\-exit\-0\fR is only1357effective before the interactive finder starts but \fBzero\fR event is1358triggered by the interactive finder.13591360e.g.1361 \fB# Reload the candidate list when there's no match1362 echo $RANDOM | fzf --bind 'zero:reload(echo $RANDOM)+clear-query' --height 3\fR1362 echo $RANDOM | fzf \-\-bind 'zero:reload(echo $RANDOM)+clear\-query' \-\-height 3\fR1363.RE13641365\fIbackward-eof\fR1365\fIbackward\-eof\fR1366.RS1367Triggered when the query string is already empty and you try to delete it1368backward.13691370e.g.1371 \fBfzf --bind backward-eof:abort\fR1371 \fBfzf \-\-bind backward\-eof:abort\fR1372.RE13731374\fIjump\fR1375.RS1376Triggered when successfully jumped to the target item in \fBjump\fR mode.13771378e.g.1379 \fBfzf --bind space:jump,jump:accept\fR1379 \fBfzf \-\-bind space:jump,jump:accept\fR1380.RE13811382\fIjump-cancel\fR1382\fIjump\-cancel\fR1383.RS1384Triggered when \fBjump\fR mode is cancelled.13851386e.g.1387 \fBfzf --bind space:jump,jump:accept,jump-cancel:abort\fR1387 \fBfzf \-\-bind space:jump,jump:accept,jump\-cancel:abort\fR1388.RE13891390\fIclick-header\fR1390\fIclick\-header\fR1391.RS1392Triggered when a mouse click occurs within the header. Sets \fBFZF_CLICK_HEADER_LINE\fR and \fBFZF_CLICK_HEADER_COLUMN\fR environment variables starting from 1.13931394e.g.1395 \fBprintf "head1\\nhead2" | fzf --header-lines=2 --bind 'click-header:transform-prompt:printf ${FZF_CLICK_HEADER_LINE}x${FZF_CLICK_HEADER_COLUMN}'\fR1395 \fBprintf "head1\\nhead2" | fzf \-\-header\-lines=2 \-\-bind 'click\-header:transform\-prompt:printf ${FZF_CLICK_HEADER_LINE}x${FZF_CLICK_HEADER_COLUMN}'\fR13961397.RE13981399.SS AVAILABLE ACTIONS:1400A key or an event can be bound to one or more of the following actions.14011402 \fBACTION: DEFAULT BINDINGS (NOTES):1403 \fBabort\fR \fIctrl-c ctrl-g ctrl-q esc\fR1404 \fBaccept\fR \fIenter double-click\fR1405 \fBaccept-non-empty\fR (same as \fBaccept\fR except that it prevents fzf from exiting without selection)1406 \fBaccept-or-print-query\fR (same as \fBaccept\fR except that it prints the query when there's no match)1407 \fBbackward-char\fR \fIctrl-b left\fR1408 \fBbackward-delete-char\fR \fIctrl-h bspace\fR1409 \fBbackward-delete-char/eof\fR (same as \fBbackward-delete-char\fR except aborts fzf if query is empty)1410 \fBbackward-kill-word\fR \fIalt-bs\fR1411 \fBbackward-word\fR \fIalt-b shift-left\fR1403 \fBabort\fR \fIctrl\-c ctrl\-g ctrl\-q esc\fR1404 \fBaccept\fR \fIenter double\-click\fR1405 \fBaccept\-non\-empty\fR (same as \fBaccept\fR except that it prevents fzf from exiting without selection)1406 \fBaccept\-or\-print\-query\fR (same as \fBaccept\fR except that it prints the query when there's no match)1407 \fBbackward\-char\fR \fIctrl\-b left\fR1408 \fBbackward\-delete\-char\fR \fIctrl\-h bspace\fR1409 \fBbackward\-delete\-char/eof\fR (same as \fBbackward\-delete\-char\fR except aborts fzf if query is empty)1410 \fBbackward\-kill\-word\fR \fIalt\-bs\fR1411 \fBbackward\-word\fR \fIalt\-b shift\-left\fR1412 \fBbecome(...)\fR (replace fzf process with the specified command; see below for the details)1413 \fBbeginning-of-line\fR \fIctrl-a home\fR1413 \fBbeginning\-of\-line\fR \fIctrl\-a home\fR1414 \fBcancel\fR (clear query string if not empty, abort fzf otherwise)1415 \fBchange-border-label(...)\fR (change \fB--border-label\fR to the given string)1416 \fBchange-header(...)\fR (change header to the given string; doesn't affect \fB--header-lines\fR)1417 \fBchange-multi\fR (enable multi-select mode with no limit)1418 \fBchange-multi(...)\fR (enable multi-select mode with a limit or disable it with 0)1419 \fBchange-preview(...)\fR (change \fB--preview\fR option)1420 \fBchange-preview-label(...)\fR (change \fB--preview-label\fR to the given string)1421 \fBchange-preview-window(...)\fR (change \fB--preview-window\fR option; rotate through the multiple option sets separated by '|')1422 \fBchange-prompt(...)\fR (change prompt to the given string)1423 \fBchange-query(...)\fR (change query string to the given string)1424 \fBclear-screen\fR \fIctrl-l\fR1425 \fBclear-selection\fR (clear multi-selection)1415 \fBchange\-border\-label(...)\fR (change \fB\-\-border\-label\fR to the given string)1416 \fBchange\-header(...)\fR (change header to the given string; doesn't affect \fB\-\-header\-lines\fR)1417 \fBchange\-multi\fR (enable multi-select mode with no limit)1418 \fBchange\-multi(...)\fR (enable multi-select mode with a limit or disable it with 0)1419 \fBchange\-preview(...)\fR (change \fB\-\-preview\fR option)1420 \fBchange\-preview\-label(...)\fR (change \fB\-\-preview\-label\fR to the given string)1421 \fBchange\-preview\-window(...)\fR (change \fB\-\-preview\-window\fR option; rotate through the multiple option sets separated by '|')1422 \fBchange\-prompt(...)\fR (change prompt to the given string)1423 \fBchange\-query(...)\fR (change query string to the given string)1424 \fBclear\-screen\fR \fIctrl\-l\fR1425 \fBclear\-selection\fR (clear multi\-selection)1426 \fBclose\fR (close preview window if open, abort fzf otherwise)1427 \fBclear-query\fR (clear query string)1428 \fBdelete-char\fR \fIdel\fR1429 \fBdelete-char/eof\fR \fIctrl-d\fR (same as \fBdelete-char\fR except aborts fzf if query is empty)1427 \fBclear\-query\fR (clear query string)1428 \fBdelete\-char\fR \fIdel\fR1429 \fBdelete\-char/eof\fR \fIctrl\-d\fR (same as \fBdelete\-char\fR except aborts fzf if query is empty)1430 \fBdeselect\fR1431 \fBdeselect-all\fR (deselect all matches)1432 \fBdisable-search\fR (disable search functionality)1433 \fBdown\fR \fIctrl-j ctrl-n down\fR1434 \fBenable-search\fR (enable search functionality)1435 \fBend-of-line\fR \fIctrl-e end\fR1431 \fBdeselect\-all\fR (deselect all matches)1432 \fBdisable\-search\fR (disable search functionality)1433 \fBdown\fR \fIctrl\-j ctrl\-n down\fR1434 \fBenable\-search\fR (enable search functionality)1435 \fBend\-of\-line\fR \fIctrl\-e end\fR1436 \fBexecute(...)\fR (see below for the details)1437 \fBexecute-silent(...)\fR (see below for the details)1437 \fBexecute\-silent(...)\fR (see below for the details)1438 \fBfirst\fR (move to the first match; same as \fBpos(1)\fR)1439 \fBforward-char\fR \fIctrl-f right\fR1440 \fBforward-word\fR \fIalt-f shift-right\fR1439 \fBforward\-char\fR \fIctrl\-f right\fR1440 \fBforward\-word\fR \fIalt\-f shift\-right\fR1441 \fBignore\fR1442 \fBjump\fR (EasyMotion-like 2-keystroke movement)1443 \fBkill-line\fR1444 \fBkill-word\fR \fIalt-d\fR1445 \fBlast\fR (move to the last match; same as \fBpos(-1)\fR)1446 \fBnext-history\fR (\fIctrl-n\fR on \fB--history\fR)1447 \fBnext-selected\fR (move to the next selected item)1448 \fBpage-down\fR \fIpgdn\fR1449 \fBpage-up\fR \fIpgup\fR1450 \fBhalf-page-down\fR1451 \fBhalf-page-up\fR1452 \fBhide-header\fR1453 \fBhide-preview\fR1454 \fBoffset-down\fR (similar to CTRL-E of Vim)1455 \fBoffset-up\fR (similar to CTRL-Y of Vim)1456 \fBoffset-middle\fR (place the current item is in the middle of the screen)1443 \fBkill\-line\fR1444 \fBkill\-word\fR \fIalt\-d\fR1445 \fBlast\fR (move to the last match; same as \fBpos(\-1)\fR)1446 \fBnext\-history\fR (\fIctrl\-n\fR on \fB\-\-history\fR)1447 \fBnext\-selected\fR (move to the next selected item)1448 \fBpage\-down\fR \fIpgdn\fR1449 \fBpage\-up\fR \fIpgup\fR1450 \fBhalf\-page\-down\fR1451 \fBhalf\-page\-up\fR1452 \fBhide\-header\fR1453 \fBhide\-preview\fR1454 \fBoffset\-down\fR (similar to CTRL\-E of Vim)1455 \fBoffset\-up\fR (similar to CTRL\-Y of Vim)1456 \fBoffset\-middle\fR (place the current item is in the middle of the screen)1457 \fBpos(...)\fR (move cursor to the numeric position; negative number to count from the end)1458 \fBprev-history\fR (\fIctrl-p\fR on \fB--history\fR)1459 \fBprev-selected\fR (move to the previous selected item)1458 \fBprev\-history\fR (\fIctrl\-p\fR on \fB\-\-history\fR)1459 \fBprev\-selected\fR (move to the previous selected item)1460 \fBpreview(...)\fR (see below for the details)1461 \fBpreview-down\fR \fIshift-down\fR1462 \fBpreview-up\fR \fIshift-up\fR1463 \fBpreview-page-down\fR1464 \fBpreview-page-up\fR1465 \fBpreview-half-page-down\fR1466 \fBpreview-half-page-up\fR1467 \fBpreview-bottom\fR1468 \fBpreview-top\fR1461 \fBpreview\-down\fR \fIshift\-down\fR1462 \fBpreview\-up\fR \fIshift\-up\fR1463 \fBpreview\-page\-down\fR1464 \fBpreview\-page\-up\fR1465 \fBpreview\-half\-page\-down\fR1466 \fBpreview\-half\-page\-up\fR1467 \fBpreview\-bottom\fR1468 \fBpreview\-top\fR1469 \fBprint(...)\fR (add string to the output queue and print on exit)1470 \fBput\fR (put the character to the prompt)1471 \fBput(...)\fR (put the given string to the prompt)1472 \fBrefresh-preview\fR1472 \fBrefresh\-preview\fR1473 \fBrebind(...)\fR (rebind bindings after \fBunbind\fR)1474 \fBreload(...)\fR (see below for the details)1475 \fBreload-sync(...)\fR (see below for the details)1476 \fBreplace-query\fR (replace query string with the current selection)1475 \fBreload\-sync(...)\fR (see below for the details)1476 \fBreplace\-query\fR (replace query string with the current selection)1477 \fBselect\fR1478 \fBselect-all\fR (select all matches)1479 \fBshow-header\fR1480 \fBshow-preview\fR1481 \fBtoggle\fR (\fIright-click\fR)1482 \fBtoggle-all\fR (toggle all matches)1483 \fBtoggle+down\fR \fIctrl-i (tab)\fR1484 \fBtoggle-header\fR1485 \fBtoggle-in\fR (\fB--layout=reverse*\fR ? \fBtoggle+up\fR : \fBtoggle+down\fR)1486 \fBtoggle-out\fR (\fB--layout=reverse*\fR ? \fBtoggle+down\fR : \fBtoggle+up\fR)1487 \fBtoggle-preview\fR1488 \fBtoggle-preview-wrap\fR1489 \fBtoggle-search\fR (toggle search functionality)1490 \fBtoggle-sort\fR1491 \fBtoggle-track\fR (toggle global tracking option (\fB--track\fR))1492 \fBtoggle-track-current\fR (toggle tracking of the current item)1493 \fBtoggle+up\fR \fIbtab (shift-tab)\fR1494 \fBtrack-current\fR (track the current item; automatically disabled if focus changes)1478 \fBselect\-all\fR (select all matches)1479 \fBshow\-header\fR1480 \fBshow\-preview\fR1481 \fBtoggle\fR (\fIright\-click\fR)1482 \fBtoggle\-all\fR (toggle all matches)1483 \fBtoggle+down\fR \fIctrl\-i (tab)\fR1484 \fBtoggle\-header\fR1485 \fBtoggle\-in\fR (\fB\-\-layout=reverse*\fR ? \fBtoggle+up\fR : \fBtoggle+down\fR)1486 \fBtoggle\-out\fR (\fB\-\-layout=reverse*\fR ? \fBtoggle+down\fR : \fBtoggle+up\fR)1487 \fBtoggle\-preview\fR1488 \fBtoggle\-preview\-wrap\fR1489 \fBtoggle\-search\fR (toggle search functionality)1490 \fBtoggle\-sort\fR1491 \fBtoggle\-track\fR (toggle global tracking option (\fB\-\-track\fR))1492 \fBtoggle\-track\-current\fR (toggle tracking of the current item)1493 \fBtoggle+up\fR \fIbtab (shift\-tab)\fR1494 \fBtrack\-current\fR (track the current item; automatically disabled if focus changes)1495 \fBtransform(...)\fR (transform states using the output of an external command)1496 \fBtransform-border-label(...)\fR (transform border label using an external command)1497 \fBtransform-header(...)\fR (transform header using an external command)1498 \fBtransform-preview-label(...)\fR (transform preview label using an external command)1499 \fBtransform-prompt(...)\fR (transform prompt string using an external command)1500 \fBtransform-query(...)\fR (transform query string using an external command)1496 \fBtransform\-border\-label(...)\fR (transform border label using an external command)1497 \fBtransform\-header(...)\fR (transform header using an external command)1498 \fBtransform\-preview\-label(...)\fR (transform preview label using an external command)1499 \fBtransform\-prompt(...)\fR (transform prompt string using an external command)1500 \fBtransform\-query(...)\fR (transform query string using an external command)1501 \fBunbind(...)\fR (unbind bindings)1502 \fBunix-line-discard\fR \fIctrl-u\fR1503 \fBunix-word-rubout\fR \fIctrl-w\fR1504 \fBuntrack-current\fR (stop tracking the current item; no-op if global tracking is enabled)1505 \fBup\fR \fIctrl-k ctrl-p up\fR1506 \fByank\fR \fIctrl-y\fR1502 \fBunix\-line\-discard\fR \fIctrl\-u\fR1503 \fBunix\-word\-rubout\fR \fIctrl\-w\fR1504 \fBuntrack\-current\fR (stop tracking the current item; no-op if global tracking is enabled)1505 \fBup\fR \fIctrl\-k ctrl\-p up\fR1506 \fByank\fR \fIctrl\-y\fR15071508.SS ACTION COMPOSITION15091510Multiple actions can be chained using \fB+\fR separator.15111512e.g.1513 \fBfzf --multi --bind 'ctrl-a:select-all+accept'\fR1514 \fBfzf --multi --bind 'ctrl-a:select-all' --bind 'ctrl-a:+accept'\fR1513 \fBfzf \-\-multi \-\-bind 'ctrl\-a:select\-all+accept'\fR1514 \fBfzf \-\-multi \-\-bind 'ctrl\-a:select\-all' \-\-bind 'ctrl\-a:+accept'\fR15151516.SS ACTION ARGUMENT15171518An action denoted with \fB(...)\fR suffix takes an argument.15191520e.g.1521 \fBfzf --bind 'ctrl-a:change-prompt(NewPrompt> )'\fR1522 \fBfzf --bind 'ctrl-v:preview(cat {})' --preview-window hidden\fR1521 \fBfzf \-\-bind 'ctrl\-a:change\-prompt(NewPrompt> )'\fR1522 \fBfzf \-\-bind 'ctrl\-v:preview(cat {})' \-\-preview\-window hidden\fR15231524If the argument contains parentheses, fzf may fail to parse the expression. In1525that case, you can use any of the following alternative notations to avoid1526parse errors.15271528 \fBaction-name[...]\fR1529 \fBaction-name{...}\fR1530 \fBaction-name<...>\fR1531 \fBaction-name~...~\fR1532 \fBaction-name!...!\fR1533 \fBaction-name@...@\fR1534 \fBaction-name#...#\fR1535 \fBaction-name$...$\fR1536 \fBaction-name%...%\fR1537 \fBaction-name^...^\fR1538 \fBaction-name&...&\fR1539 \fBaction-name*...*\fR1540 \fBaction-name;...;\fR1541 \fBaction-name/.../\fR1542 \fBaction-name|...|\fR1543 \fBaction-name:...\fR1528 \fBaction\-name[...]\fR1529 \fBaction\-name{...}\fR1530 \fBaction\-name<...>\fR1531 \fBaction\-name~...~\fR1532 \fBaction\-name!...!\fR1533 \fBaction\-name@...@\fR1534 \fBaction\-name#...#\fR1535 \fBaction\-name$...$\fR1536 \fBaction\-name%...%\fR1537 \fBaction\-name^...^\fR1538 \fBaction\-name&...&\fR1539 \fBaction\-name*...*\fR1540 \fBaction\-name;...;\fR1541 \fBaction\-name/.../\fR1542 \fBaction\-name|...|\fR1543 \fBaction\-name:...\fR1544.RS1545The last one is the special form that frees you from parse errors as it does1546not expect the closing character. The catch is that it should be the last one1547in the comma-separated list of key-action pairs.
4 unmodified lines
1552With \fBexecute(...)\fR action, you can execute arbitrary commands without1553leaving fzf. For example, you can turn fzf into a simple file browser by1554binding \fBenter\fR key to \fBless\fR command like follows.15551556 \fBfzf --bind "enter:execute(less {})"\fR1556 \fBfzf \-\-bind "enter:execute(less {})"\fR15571558You can use the same placeholder expressions as in \fB--preview\fR.1558You can use the same placeholder expressions as in \fB\-\-preview\fR.15591560fzf switches to the alternate screen when executing a command. However, if the1561command is expected to complete quickly, and you are not interested in its1562output, you might want to use \fBexecute-silent\fR instead, which silently1562output, you might want to use \fBexecute\-silent\fR instead, which silently1563executes the command without the switching. Note that fzf will not be1564responsive until the command is complete. For asynchronous execution, start1565your command as a background process (i.e. appending \fB&\fR).15661567On *nix systems, fzf runs the command with \fB$SHELL -c\fR if \fBSHELL\fR is1568set, otherwise with \fBsh -c\fR, so in this case make sure that the command is1567On *nix systems, fzf runs the command with \fB$SHELL \-c\fR if \fBSHELL\fR is1568set, otherwise with \fBsh \-c\fR, so in this case make sure that the command is1569POSIX-compliant.15701571\fBbecome(...)\fR action is similar to \fBexecute(...)\fR, but it replaces the1572current fzf process with the specified command using \fBexecve(2)\fR system1573call.15741575 \fBfzf --bind "enter:become(vim {})"\fR1575 \fBfzf \-\-bind "enter:become(vim {})"\fR15761577.SS RELOAD INPUT15781579\fBreload(...)\fR action is used to dynamically update the input list
2 unmodified lines
15821583See \fIhttps://github.com/junegunn/fzf/issues/1750\fR for more info.15841585e.g.1586 \fB# Update the list of processes by pressing CTRL-R1587 ps -ef | fzf --bind 'ctrl-r:reload(ps -ef)' --header 'Press CTRL-R to reload' \\1588 --header-lines=1 --layout=reverse1586 \fB# Update the list of processes by pressing CTRL\-R1587 ps \-ef | fzf \-\-bind 'ctrl\-r:reload(ps \-ef)' \-\-header 'Press CTRL\-R to reload' \\1588 \-\-header\-lines=1 \-\-layout=reverse15891590 # Integration with ripgrep1591 RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "1591 RG_PREFIX="rg \-\-column \-\-line\-number \-\-no\-heading \-\-color=always \-\-smart\-case "1592 INITIAL_QUERY="foobar"1593 FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \\1594 fzf --bind "change:reload:$RG_PREFIX {q} || true" \\1595 --ansi --disabled --query "$INITIAL_QUERY"\fR1594 fzf \-\-bind "change:reload:$RG_PREFIX {q} || true" \\1595 \-\-ansi \-\-disabled \-\-query "$INITIAL_QUERY"\fR15961597\fBreload-sync(...)\fR is a synchronous version of \fBreload\fR that replaces1597\fBreload\-sync(...)\fR is a synchronous version of \fBreload\fR that replaces1598the list only when the command is complete. This is useful when the command1599takes a while to produce the initial output and you don't want fzf to run1600against an empty list while the command is running.160116021603e.g.1604 \fB# You can still filter and select entries from the initial list for 3 seconds1605 seq 100 | fzf --bind 'load:reload-sync(sleep 3; seq 1000)+unbind(load)'\fR1605 seq 100 | fzf \-\-bind 'load:reload\-sync(sleep 3; seq 1000)+unbind(load)'\fR16061607.SS TRANSFORM ACTIONS16081609Actions with \fBtransform-\fR prefix are used to transform the states of fzf1609Actions with \fBtransform\-\fR prefix are used to transform the states of fzf1610using the output of an external command. The output of these commands are1611expected to be a single line of text.16121613e.g.1614 \fBfzf --bind 'focus:transform-header:file --brief {}'\fR1614 \fBfzf \-\-bind 'focus:transform\-header:file \-\-brief {}'\fR16151616\fBtransform(...)\fR action runs an external command that should print a series1617of actions to be performed. The output should be in the same format as the1618payload of HTTP POST request to the \fB--listen\fR server.1618payload of HTTP POST request to the \fB\-\-listen\fR server.16191620e.g.1621 \fB# Disallow selecting an empty line1622 echo -e "1. Hello\\n2. Goodbye\\n\\n3. Exit" |1623 fzf --height '~100%' --reverse --header 'Select one' \\1624 --bind 'enter:transform:[[ -n {} ]] &&1622 echo \-e "1. Hello\\n2. Goodbye\\n\\n3. Exit" |1623 fzf \-\-height '~100%' \-\-reverse \-\-header 'Select one' \\1624 \-\-bind 'enter:transform:[[ \-n {} ]] &&1625 echo accept ||1626 echo "change-header:Invalid selection"'1626 echo "change\-header:Invalid selection"'1627 \fR16281629.SS PREVIEW BINDING16301631With \fBpreview(...)\fR action, you can specify multiple different preview1632commands in addition to the default preview command given by \fB--preview\fR1632commands in addition to the default preview command given by \fB\-\-preview\fR1633option.16341635e.g.1636 # Default preview command with an extra preview binding1637 fzf --preview 'file {}' --bind '?:preview:cat {}'1637 fzf \-\-preview 'file {}' \-\-bind '?:preview:cat {}'16381639 # A preview binding with no default preview command1640 # (Preview window is initially empty)1641 fzf --bind '?:preview:cat {}'1641 fzf \-\-bind '?:preview:cat {}'16421643 # Preview window hidden by default, it appears when you first hit '?'1644 fzf --bind '?:preview:cat {}' --preview-window hidden1644 fzf \-\-bind '?:preview:cat {}' \-\-preview\-window hidden16451646.SS CHANGE PREVIEW WINDOW ATTRIBUTES16471648\fBchange-preview-window\fR action can be used to change the properties of the1649preview window. Unlike the \fB--preview-window\fR option, you can specify1648\fBchange\-preview\-window\fR action can be used to change the properties of the1649preview window. Unlike the \fB\-\-preview\-window\fR option, you can specify1650multiple sets of options separated by '|' characters.16511652e.g.1653 # Rotate through the options using CTRL-/1654 fzf --preview 'cat {}' --bind 'ctrl-/:change-preview-window(right,70%|down,40%,border-horizontal|hidden|right)'1653 # Rotate through the options using CTRL\-/1654 fzf \-\-preview 'cat {}' \-\-bind 'ctrl\-/:change\-preview\-window(right,70%|down,40%,border\-horizontal|hidden|right)'16551656 # The default properties given by `--preview-window` are inherited, so an empty string in the list is interpreted as the default1657 fzf --preview 'cat {}' --preview-window 'right,40%,border-left' --bind 'ctrl-/:change-preview-window(70%|down,border-top|hidden|)'1656 # The default properties given by `\-\-preview\-window` are inherited, so an empty string in the list is interpreted as the default1657 fzf \-\-preview 'cat {}' \-\-preview\-window 'right,40%,border\-left' \-\-bind 'ctrl\-/:change\-preview\-window(70%|down,border\-top|hidden|)'16581659 # This is equivalent to toggle-preview action1660 fzf --preview 'cat {}' --bind 'ctrl-/:change-preview-window(hidden|)'1659 # This is equivalent to toggle\-preview action1660 fzf \-\-preview 'cat {}' \-\-bind 'ctrl\-/:change\-preview\-window(hidden|)'16611662.SH AUTHOR1663Junegunn Choi (\fIjunegunn.c@gmail.com\fR)1664
15 unmodified lines