mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-25 14:17:40 +00:00
944 lines
28 KiB
Groff
944 lines
28 KiB
Groff
.ig
|
|
The MIT License (MIT)
|
|
|
|
Copyright (c) 2013-2020 Junegunn Choi
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
..
|
|
.TH fzf 1 "Dec 2020" "fzf 0.24.4" "fzf - a command-line fuzzy finder"
|
|
|
|
.SH NAME
|
|
fzf - a command-line fuzzy finder
|
|
|
|
.SH SYNOPSIS
|
|
fzf [options]
|
|
|
|
.SH DESCRIPTION
|
|
fzf is a general-purpose command-line fuzzy finder.
|
|
|
|
.SH OPTIONS
|
|
.SS Search mode
|
|
.TP
|
|
.B "-x, --extended"
|
|
Extended-search mode. Since 0.10.9, this is enabled by default. You can disable
|
|
it with \fB+x\fR or \fB--no-extended\fR.
|
|
.TP
|
|
.B "-e, --exact"
|
|
Enable exact-match
|
|
.TP
|
|
.B "-i"
|
|
Case-insensitive match (default: smart-case match)
|
|
.TP
|
|
.B "+i"
|
|
Case-sensitive match
|
|
.TP
|
|
.B "--literal"
|
|
Do not normalize latin script letters for matching.
|
|
.TP
|
|
.BI "--algo=" TYPE
|
|
Fuzzy matching algorithm (default: v2)
|
|
|
|
.br
|
|
.BR v2 " Optimal scoring algorithm (quality)"
|
|
.br
|
|
.BR v1 " Faster but not guaranteed to find the optimal result (performance)"
|
|
.br
|
|
|
|
.TP
|
|
.BI "-n, --nth=" "N[,..]"
|
|
Comma-separated list of field index expressions for limiting search scope.
|
|
See \fBFIELD INDEX EXPRESSION\fR for the details.
|
|
.TP
|
|
.BI "--with-nth=" "N[,..]"
|
|
Transform the presentation of each line using field index expressions
|
|
.TP
|
|
.BI "-d, --delimiter=" "STR"
|
|
Field delimiter regex for \fB--nth\fR and \fB--with-nth\fR (default: AWK-style)
|
|
.TP
|
|
.BI "--phony"
|
|
Do not perform search. With this option, fzf becomes a simple selector
|
|
interface rather than a "fuzzy finder".
|
|
.SS Search result
|
|
.TP
|
|
.B "+s, --no-sort"
|
|
Do not sort the result
|
|
.TP
|
|
.B "--tac"
|
|
Reverse the order of the input
|
|
|
|
.RS
|
|
e.g.
|
|
\fBhistory | fzf --tac --no-sort\fR
|
|
.RE
|
|
.TP
|
|
.BI "--tiebreak=" "CRI[,..]"
|
|
Comma-separated list of sort criteria to apply when the scores are tied.
|
|
.br
|
|
|
|
.br
|
|
.BR length " Prefers line with shorter length"
|
|
.br
|
|
.BR begin " Prefers line with matched substring closer to the beginning"
|
|
.br
|
|
.BR end " Prefers line with matched substring closer to the end"
|
|
.br
|
|
.BR index " Prefers line that appeared earlier in the input stream"
|
|
.br
|
|
|
|
.br
|
|
- Each criterion should appear only once in the list
|
|
.br
|
|
- \fBindex\fR is only allowed at the end of the list
|
|
.br
|
|
- \fBindex\fR is implicitly appended to the list when not specified
|
|
.br
|
|
- Default is \fBlength\fR (or equivalently \fBlength\fR,index)
|
|
.br
|
|
- If \fBend\fR is found in the list, fzf will scan each line backwards
|
|
.SS Interface
|
|
.TP
|
|
.B "-m, --multi"
|
|
Enable multi-select with tab/shift-tab. It optionally takes an integer argument
|
|
which denotes the maximum number of items that can be selected.
|
|
.TP
|
|
.B "+m, --no-multi"
|
|
Disable multi-select
|
|
.TP
|
|
.B "--no-mouse"
|
|
Disable mouse
|
|
.TP
|
|
.BI "--bind=" "KEYBINDS"
|
|
Comma-separated list of custom key bindings. See \fBKEY/EVENT BINDINGS\fR for
|
|
the details.
|
|
.TP
|
|
.B "--cycle"
|
|
Enable cyclic scroll
|
|
.TP
|
|
.B "--keep-right"
|
|
Keep the right end of the line visible when it's too long. Effective only when
|
|
the query string is empty.
|
|
.TP
|
|
.B "--no-hscroll"
|
|
Disable horizontal scroll
|
|
.TP
|
|
.BI "--hscroll-off=" "COL"
|
|
Number of screen columns to keep to the right of the highlighted substring
|
|
(default: 10). Setting it to a large value will cause the text to be positioned
|
|
on the center of the screen.
|
|
.TP
|
|
.B "--filepath-word"
|
|
Make word-wise movements and actions respect path separators. The following
|
|
actions are affected:
|
|
|
|
\fBbackward-kill-word\fR
|
|
.br
|
|
\fBbackward-word\fR
|
|
.br
|
|
\fBforward-word\fR
|
|
.br
|
|
\fBkill-word\fR
|
|
.TP
|
|
.BI "--jump-labels=" "CHARS"
|
|
Label characters for \fBjump\fR and \fBjump-accept\fR
|
|
.SS Layout
|
|
.TP
|
|
.BI "--height=" "HEIGHT[%]"
|
|
Display fzf window below the cursor with the given height instead of using
|
|
the full screen.
|
|
.TP
|
|
.BI "--min-height=" "HEIGHT"
|
|
Minimum height when \fB--height\fR is given in percent (default: 10).
|
|
Ignored when \fB--height\fR is not specified.
|
|
.TP
|
|
.BI "--layout=" "LAYOUT"
|
|
Choose the layout (default: default)
|
|
|
|
.br
|
|
.BR default " Display from the bottom of the screen"
|
|
.br
|
|
.BR reverse " Display from the top of the screen"
|
|
.br
|
|
.BR reverse-list " Display from the top of the screen, prompt at the bottom"
|
|
.br
|
|
|
|
.TP
|
|
.B "--reverse"
|
|
A synonym for \fB--layout=reverse\fB
|
|
|
|
.TP
|
|
.BI "--border" [=STYLE]
|
|
Draw border around the finder
|
|
|
|
.br
|
|
.BR rounded " Border with rounded corners (default)"
|
|
.br
|
|
.BR sharp " Border with sharp corners"
|
|
.br
|
|
.BR horizontal " Horizontal lines above and below the finder"
|
|
.br
|
|
.BR vertical " Vertical lines on each side of the finder"
|
|
.br
|
|
.BR top
|
|
.br
|
|
.BR bottom
|
|
.br
|
|
.BR left
|
|
.br
|
|
.BR right
|
|
.br
|
|
|
|
.TP
|
|
.B "--no-unicode"
|
|
Use ASCII characters instead of Unicode box drawing characters to draw border
|
|
|
|
.TP
|
|
.BI "--margin=" MARGIN
|
|
Comma-separated expression for margins around the finder.
|
|
.br
|
|
|
|
.br
|
|
.RS
|
|
.BR TRBL " Same margin for top, right, bottom, and left"
|
|
.br
|
|
.BR TB,RL " Vertical, horizontal margin"
|
|
.br
|
|
.BR T,RL,B " Top, horizontal, bottom margin"
|
|
.br
|
|
.BR T,R,B,L " Top, right, bottom, left margin"
|
|
.br
|
|
|
|
.br
|
|
Each part can be given in absolute number or in percentage relative to the
|
|
terminal size with \fB%\fR suffix.
|
|
.br
|
|
|
|
.br
|
|
e.g.
|
|
\fBfzf --margin 10%
|
|
fzf --margin 1,5%\fR
|
|
.RE
|
|
.TP
|
|
.BI "--padding=" PADDING
|
|
Comma-separated expression for padding inside the border. Padding is
|
|
distinguishable from margin only when \fB--border\fR option is used.
|
|
.br
|
|
|
|
.br
|
|
e.g.
|
|
\fBfzf --margin 5% --padding 5% --border --preview 'cat {}' \\
|
|
--color bg:#222222,preview-bg:#333333\fR
|
|
|
|
.br
|
|
.RS
|
|
.BR TRBL " Same padding for top, right, bottom, and left"
|
|
.br
|
|
.BR TB,RL " Vertical, horizontal padding"
|
|
.br
|
|
.BR T,RL,B " Top, horizontal, bottom padding"
|
|
.br
|
|
.BR T,R,B,L " Top, right, bottom, left padding"
|
|
.br
|
|
.RE
|
|
|
|
.TP
|
|
.BI "--info=" "STYLE"
|
|
Determines the display style of finder info.
|
|
|
|
.br
|
|
.BR default " Display on the next line to the prompt"
|
|
.br
|
|
.BR inline " Display on the same line"
|
|
.br
|
|
.BR hidden " Do not display finder info"
|
|
.br
|
|
|
|
.TP
|
|
.B "--no-info"
|
|
A synonym for \fB--info=hidden\fB
|
|
|
|
.TP
|
|
.BI "--prompt=" "STR"
|
|
Input prompt (default: '> ')
|
|
.TP
|
|
.BI "--pointer=" "STR"
|
|
Pointer to the current line (default: '>')
|
|
.TP
|
|
.BI "--marker=" "STR"
|
|
Multi-select marker (default: '>')
|
|
.TP
|
|
.BI "--header=" "STR"
|
|
The given string will be printed as the sticky header. The lines are displayed
|
|
in the given order from top to bottom regardless of \fB--layout\fR option, and
|
|
are not affected by \fB--with-nth\fR. ANSI color codes are processed even when
|
|
\fB--ansi\fR is not set.
|
|
.TP
|
|
.BI "--header-lines=" "N"
|
|
The first N lines of the input are treated as the sticky header. When
|
|
\fB--with-nth\fR is set, the lines are transformed just like the other
|
|
lines that follow.
|
|
.SS Display
|
|
.TP
|
|
.B "--ansi"
|
|
Enable processing of ANSI color codes
|
|
.TP
|
|
.BI "--tabstop=" SPACES
|
|
Number of spaces for a tab character (default: 8)
|
|
.TP
|
|
.BI "--color=" "[BASE_SCHEME][,COLOR_NAME[:ANSI_COLOR][:ANSI_ATTRIBUTES]]..."
|
|
Color configuration. The name of the base color scheme is followed by custom
|
|
color mappings.
|
|
|
|
.RS
|
|
.B BASE SCHEME:
|
|
(default: dark on 256-color terminal, otherwise 16)
|
|
|
|
\fBdark \fRColor scheme for dark 256-color terminal
|
|
\fBlight \fRColor scheme for light 256-color terminal
|
|
\fB16 \fRColor scheme for 16-color terminal
|
|
\fBbw \fRNo colors (equivalent to \fB--no-color\fR)
|
|
|
|
.B COLOR NAMES:
|
|
\fBfg \fRText
|
|
\fBbg \fRBackground
|
|
\fBpreview-fg \fRPreview window text
|
|
\fBpreview-bg \fRPreview window background
|
|
\fBhl \fRHighlighted substrings
|
|
\fBfg+ \fRText (current line)
|
|
\fBbg+ \fRBackground (current line)
|
|
\fBgutter \fRGutter on the left (defaults to \fBbg+\fR)
|
|
\fBhl+ \fRHighlighted substrings (current line)
|
|
\fBinfo \fRInfo line (match counters)
|
|
\fBborder \fRBorder around the window (\fB--border\fR and \fB--preview\fR)
|
|
\fBprompt \fRPrompt
|
|
\fBpointer \fRPointer to the current line
|
|
\fBmarker \fRMulti-select marker
|
|
\fBspinner \fRStreaming input indicator
|
|
\fBheader \fRHeader
|
|
|
|
.B ANSI COLORS:
|
|
\fB-1 \fRDefault terminal foreground/background color
|
|
\fB \fR(or the original color of the text)
|
|
\fB0 ~ 15 \fR16 base colors
|
|
\fB16 ~ 255 \fRANSI 256 colors
|
|
\fB#rrggbb \fR24-bit colors
|
|
|
|
.B ANSI ATTRIBUTES: (Only applies to foreground colors)
|
|
\fBregular \fRClears previously set attributes; should precede the other ones
|
|
\fBbold\fR
|
|
\fBunderline\fR
|
|
\fBreverse\fR
|
|
\fBdim\fR
|
|
\fBitalic\fR
|
|
|
|
.B EXAMPLES:
|
|
|
|
\fB# Seoul256 theme with 8-bit colors
|
|
# (https://github.com/junegunn/seoul256.vim)
|
|
fzf --color='bg:237,bg+:236,info:143,border:240,spinner:108' \\
|
|
--color='hl:65,fg:252,header:65,fg+:252' \\
|
|
--color='pointer:161,marker:168,prompt:110,hl+:108'
|
|
|
|
# Seoul256 theme with 24-bit colors
|
|
fzf --color='bg:#4B4B4B,bg+:#3F3F3F,info:#BDBB72,border:#6B6B6B,spinner:#98BC99' \\
|
|
--color='hl:#719872,fg:#D9D9D9,header:#719872,fg+:#D9D9D9' \\
|
|
--color='pointer:#E12672,marker:#E17899,prompt:#98BEDE,hl+:#98BC99'\fR
|
|
.RE
|
|
.TP
|
|
.B "--no-bold"
|
|
Do not use bold text
|
|
.TP
|
|
.B "--black"
|
|
Use black background
|
|
.SS History
|
|
.TP
|
|
.BI "--history=" "HISTORY_FILE"
|
|
Load search history from the specified file and update the file on completion.
|
|
When enabled, \fBCTRL-N\fR and \fBCTRL-P\fR are automatically remapped to
|
|
\fBnext-history\fR and \fBprevious-history\fR.
|
|
.TP
|
|
.BI "--history-size=" "N"
|
|
Maximum number of entries in the history file (default: 1000). The file is
|
|
automatically truncated when the number of the lines exceeds the value.
|
|
.SS Preview
|
|
.TP
|
|
.BI "--preview=" "COMMAND"
|
|
Execute the given command for the current line and display the result on the
|
|
preview window. \fB{}\fR in the command is the placeholder that is replaced to
|
|
the single-quoted string of the current line. To transform the replacement
|
|
string, specify field index expressions between the braces (See \fBFIELD INDEX
|
|
EXPRESSION\fR for the details).
|
|
|
|
.RS
|
|
e.g.
|
|
\fBfzf --preview='head -$LINES {}'
|
|
ls -l | fzf --preview="echo user={3} when={-4..-2}; cat {-1}" --header-lines=1\fR
|
|
|
|
fzf exports \fB$FZF_PREVIEW_LINES\fR and \fB$FZF_PREVIEW_COLUMNS\fR so that
|
|
they represent the exact size of the preview window. (It also overrides
|
|
\fB$LINES\fR and \fB$COLUMNS\fR with the same values but they can be reset
|
|
by the default shell, so prefer to refer to the ones with \fBFZF_PREVIEW_\fR
|
|
prefix.)
|
|
|
|
A placeholder expression starting with \fB+\fR flag will be replaced to the
|
|
space-separated list of the selected lines (or the current line if no selection
|
|
was made) individually quoted.
|
|
|
|
e.g.
|
|
\fBfzf --multi --preview='head -10 {+}'
|
|
git log --oneline | fzf --multi --preview 'git show {+1}'\fR
|
|
|
|
When using a field index expression, leading and trailing whitespace is stripped
|
|
from the replacement string. To preserve the whitespace, use the \fBs\fR flag.
|
|
|
|
Also, \fB{q}\fR is replaced to the current query string, and \fB{n}\fR is
|
|
replaced to zero-based ordinal index of the line. Use \fB{+n}\fR if you want
|
|
all index numbers when multiple lines are selected.
|
|
|
|
A placeholder expression with \fBf\fR flag is replaced to the path of
|
|
a temporary file that holds the evaluated list. This is useful when you
|
|
multi-select a large number of items and the length of the evaluated string may
|
|
exceed \fBARG_MAX\fR.
|
|
|
|
e.g.
|
|
\fB# Press CTRL-A to select 100K items and see the sum of all the numbers.
|
|
# This won't work properly without 'f' flag due to ARG_MAX limit.
|
|
seq 100000 | fzf --multi --bind ctrl-a:select-all \\
|
|
--preview "awk '{sum+=\$1} END {print sum}' {+f}"\fR
|
|
|
|
Note that you can escape a placeholder pattern by prepending a backslash.
|
|
|
|
Preview window will be updated even when there is no match for the current
|
|
query if any of the placeholder expressions evaluates to a non-empty string.
|
|
|
|
Since 0.24.0, fzf can render partial preview content before the preview command
|
|
completes. ANSI escape sequence for clearing the display (\fBCSI 2 J\fR) is
|
|
supported, so you can use it to implement preview window that is constantly
|
|
updating.
|
|
|
|
e.g.
|
|
\fBfzf --preview 'for i in $(seq 100000); do
|
|
(( i % 200 == 0 )) && printf "\\033[2J"
|
|
echo "$i"
|
|
sleep 0.01
|
|
done'\fR
|
|
.RE
|
|
.TP
|
|
.BI "--preview-window=" "[POSITION][:SIZE[%]][:rounded|sharp|noborder][:[no]wrap][:[no]follow][:[no]cycle][:[no]hidden][:+SCROLL[-OFFSET]][:default]"
|
|
|
|
.RS
|
|
.B POSITION: (default: right)
|
|
\fBup
|
|
\fBdown
|
|
\fBleft
|
|
\fBright
|
|
|
|
\fRDetermines the layout of the preview window.
|
|
|
|
* If the argument contains \fB:hidden\fR, the preview window will be hidden by
|
|
default until \fBtoggle-preview\fR action is triggered.
|
|
|
|
* If size is given as 0, preview window will not be visible, but fzf will still
|
|
execute the command in the background.
|
|
|
|
* Long lines are truncated by default. Line wrap can be enabled with
|
|
\fB:wrap\fR flag.
|
|
|
|
* Preview window will automatically scroll to the bottom when \fB:follow\fR
|
|
flag is set, similarly to how \fBtail -f\fR works.
|
|
|
|
.RS
|
|
e.g.
|
|
\fBfzf --preview-window follow --preview 'for i in $(seq 100000); do
|
|
echo "$i"
|
|
sleep 0.01
|
|
(( i % 300 == 0 )) && printf "\\033[2J"
|
|
done'\fR
|
|
.RE
|
|
|
|
* Cyclic scrolling is enabled with \fB:cycle\fR flag.
|
|
|
|
* To change the style of the border of the preview window, specify one of
|
|
\fBrounded\fR (border with rounded edges, default), \fBsharp\fR (border with
|
|
sharp edges), or \fBnoborder\fR (no border).
|
|
|
|
* \fB+SCROLL[-OFFSET]\fR determines the initial scroll offset of the preview
|
|
window. \fBSCROLL\fR can be either a numeric integer or a single-field index
|
|
expression that refers to a numeric integer. The optional \fB-OFFSET\fR part is
|
|
for adjusting the base offset so that you can see the text above it. It should
|
|
be given as a numeric integer (\fB-INTEGER\fR), or as a denominator form
|
|
(\fB-/INTEGER\fR) for specifying a fraction of the preview window height.
|
|
|
|
* \fBdefault\fR resets all options previously set to the default.
|
|
|
|
.RS
|
|
e.g.
|
|
\fB# Non-default scroll window positions and sizes
|
|
fzf --preview="head {}" --preview-window=up:30%
|
|
fzf --preview="file {}" --preview-window=down:1
|
|
|
|
# Initial scroll offset is set to the line number of each line of
|
|
# git grep output *minus* 5 lines (-5)
|
|
git grep --line-number '' |
|
|
fzf --delimiter : --preview 'nl {1}' --preview-window +{2}-5
|
|
|
|
# Preview with bat, matching line in the middle of the window (-/2)
|
|
git grep --line-number '' |
|
|
fzf --delimiter : \\
|
|
--preview 'bat --style=numbers --color=always --highlight-line {2} {1}' \\
|
|
--preview-window +{2}-/2\fR
|
|
|
|
.RE
|
|
|
|
.SS Scripting
|
|
.TP
|
|
.BI "-q, --query=" "STR"
|
|
Start the finder with the given query
|
|
.TP
|
|
.B "-1, --select-1"
|
|
Automatically select the only match
|
|
.TP
|
|
.B "-0, --exit-0"
|
|
Exit immediately when there's no match
|
|
.TP
|
|
.BI "-f, --filter=" "STR"
|
|
Filter mode. Do not start interactive finder. When used with \fB--no-sort\fR,
|
|
fzf becomes a fuzzy-version of grep.
|
|
.TP
|
|
.B "--print-query"
|
|
Print query as the first line
|
|
.TP
|
|
.BI "--expect=" "KEY[,..]"
|
|
Comma-separated list of keys that can be used to complete fzf in addition to
|
|
the default enter key. When this option is set, fzf will print the name of the
|
|
key pressed as the first line of its output (or as the second line if
|
|
\fB--print-query\fR is also used). The line will be empty if fzf is completed
|
|
with the default enter key. If \fB--expect\fR option is specified multiple
|
|
times, fzf will expect the union of the keys. \fB--no-expect\fR will clear the
|
|
list.
|
|
|
|
.RS
|
|
e.g.
|
|
\fBfzf --expect=ctrl-v,ctrl-t,alt-s --expect=f1,f2,~,@\fR
|
|
.RE
|
|
.TP
|
|
.B "--read0"
|
|
Read input delimited by ASCII NUL characters instead of newline characters
|
|
.TP
|
|
.B "--print0"
|
|
Print output delimited by ASCII NUL characters instead of newline characters
|
|
.TP
|
|
.B "--no-clear"
|
|
Do not clear finder interface on exit. If fzf was started in full screen mode,
|
|
it will not switch back to the original screen, so you'll have to manually run
|
|
\fBtput rmcup\fR to return. This option can be used to avoid flickering of the
|
|
screen when your application needs to start fzf multiple times in order.
|
|
.TP
|
|
.B "--sync"
|
|
Synchronous search for multi-staged filtering. If specified, fzf will launch
|
|
ncurses finder only after the input stream is complete.
|
|
|
|
.RS
|
|
e.g. \fBfzf --multi | fzf --sync\fR
|
|
.RE
|
|
.TP
|
|
.B "--version"
|
|
Display version information and exit
|
|
|
|
.TP
|
|
Note that most options have the opposite versions with \fB--no-\fR prefix.
|
|
|
|
.SH ENVIRONMENT VARIABLES
|
|
.TP
|
|
.B FZF_DEFAULT_COMMAND
|
|
Default command to use when input is tty. On *nix systems, fzf runs the command
|
|
with \fBsh -c\fR, so make sure that it's POSIX-compliant.
|
|
.TP
|
|
.B FZF_DEFAULT_OPTS
|
|
Default options. e.g. \fBexport FZF_DEFAULT_OPTS="--extended --cycle"\fR
|
|
|
|
.SH EXIT STATUS
|
|
.BR 0 " Normal exit"
|
|
.br
|
|
.BR 1 " No match"
|
|
.br
|
|
.BR 2 " Error"
|
|
.br
|
|
.BR 130 " Interrupted with \fBCTRL-C\fR or \fBESC\fR"
|
|
|
|
.SH FIELD INDEX EXPRESSION
|
|
|
|
A field index expression can be a non-zero integer or a range expression
|
|
([BEGIN]..[END]). \fB--nth\fR and \fB--with-nth\fR take a comma-separated list
|
|
of field index expressions.
|
|
|
|
.SS Examples
|
|
.BR 1 " The 1st field"
|
|
.br
|
|
.BR 2 " The 2nd field"
|
|
.br
|
|
.BR -1 " The last field"
|
|
.br
|
|
.BR -2 " The 2nd to last field"
|
|
.br
|
|
.BR 3..5 " From the 3rd field to the 5th field"
|
|
.br
|
|
.BR 2.. " From the 2nd field to the last field"
|
|
.br
|
|
.BR ..-3 " From the 1st field to the 3rd to the last field"
|
|
.br
|
|
.BR .. " All the fields"
|
|
.br
|
|
|
|
.SH EXTENDED SEARCH MODE
|
|
|
|
Unless specified otherwise, fzf will start in "extended-search mode". In this
|
|
mode, you can specify multiple patterns delimited by spaces, such as: \fB'wild
|
|
^music .mp3$ sbtrkt !rmx\fR
|
|
|
|
You can prepend a backslash to a space (\fB\\ \fR) to match a literal space
|
|
character.
|
|
|
|
.SS Exact-match (quoted)
|
|
A term that is prefixed by a single-quote character (\fB'\fR) is interpreted as
|
|
an "exact-match" (or "non-fuzzy") term. fzf will search for the exact
|
|
occurrences of the string.
|
|
|
|
.SS Anchored-match
|
|
A term can be prefixed by \fB^\fR, or suffixed by \fB$\fR to become an
|
|
anchored-match term. Then fzf will search for the lines that start with or end
|
|
with the given string. An anchored-match term is also an exact-match term.
|
|
|
|
.SS Negation
|
|
If a term is prefixed by \fB!\fR, fzf will exclude the lines that satisfy the
|
|
term from the result. In this case, fzf performs exact match by default.
|
|
|
|
.SS Exact-match by default
|
|
If you don't prefer fuzzy matching and do not wish to "quote" (prefixing with
|
|
\fB'\fR) every word, start fzf with \fB-e\fR or \fB--exact\fR option. Note that
|
|
when \fB--exact\fR is set, \fB'\fR-prefix "unquotes" the term.
|
|
|
|
.SS OR operator
|
|
A single bar character term acts as an OR operator. For example, the following
|
|
query matches entries that start with \fBcore\fR and end with either \fBgo\fR,
|
|
\fBrb\fR, or \fBpy\fR.
|
|
|
|
e.g. \fB^core go$ | rb$ | py$\fR
|
|
|
|
.SH KEY/EVENT BINDINGS
|
|
\fB--bind\fR option allows you to bind \fBa key\fR or \fBan event\fR to one or
|
|
more \fBactions\fR. You can use it to customize key bindings or implement
|
|
dynamic behaviors.
|
|
|
|
\fB--bind\fR takes a comma-separated list of binding expressions. Each binding
|
|
expression is \fBKEY:ACTION\fR or \fBEVENT:ACTION\fR.
|
|
|
|
e.g.
|
|
\fBfzf --bind=ctrl-j:accept,ctrl-k:kill-line\fR
|
|
|
|
.SS AVAILABLE KEYS: (SYNONYMS)
|
|
\fIctrl-[a-z]\fR
|
|
.br
|
|
\fIctrl-space\fR
|
|
.br
|
|
\fIctrl-\\\fR
|
|
.br
|
|
\fIctrl-]\fR
|
|
.br
|
|
\fIctrl-^\fR (\fIctrl-6\fR)
|
|
.br
|
|
\fIctrl-/\fR (\fIctrl-_\fR)
|
|
.br
|
|
\fIctrl-alt-[a-z]\fR
|
|
.br
|
|
\fIalt-[a-z]\fR
|
|
.br
|
|
\fIalt-[0-9]\fR
|
|
.br
|
|
\fIf[1-12]\fR
|
|
.br
|
|
\fIenter\fR (\fIreturn\fR \fIctrl-m\fR)
|
|
.br
|
|
\fIspace\fR
|
|
.br
|
|
\fIbspace\fR (\fIbs\fR)
|
|
.br
|
|
\fIalt-up\fR
|
|
.br
|
|
\fIalt-down\fR
|
|
.br
|
|
\fIalt-left\fR
|
|
.br
|
|
\fIalt-right\fR
|
|
.br
|
|
\fIalt-enter\fR
|
|
.br
|
|
\fIalt-space\fR
|
|
.br
|
|
\fIalt-bspace\fR (\fIalt-bs\fR)
|
|
.br
|
|
\fIalt-/\fR
|
|
.br
|
|
\fItab\fR
|
|
.br
|
|
\fIbtab\fR (\fIshift-tab\fR)
|
|
.br
|
|
\fIesc\fR
|
|
.br
|
|
\fIdel\fR
|
|
.br
|
|
\fIup\fR
|
|
.br
|
|
\fIdown\fR
|
|
.br
|
|
\fIleft\fR
|
|
.br
|
|
\fIright\fR
|
|
.br
|
|
\fIhome\fR
|
|
.br
|
|
\fIend\fR
|
|
.br
|
|
\fIinsert\fR
|
|
.br
|
|
\fIpgup\fR (\fIpage-up\fR)
|
|
.br
|
|
\fIpgdn\fR (\fIpage-down\fR)
|
|
.br
|
|
\fIshift-up\fR
|
|
.br
|
|
\fIshift-down\fR
|
|
.br
|
|
\fIshift-left\fR
|
|
.br
|
|
\fIshift-right\fR
|
|
.br
|
|
\fIalt-shift-up\fR
|
|
.br
|
|
\fIalt-shift-down\fR
|
|
.br
|
|
\fIalt-shift-left\fR
|
|
.br
|
|
\fIalt-shift-right\fR
|
|
.br
|
|
\fIleft-click\fR
|
|
.br
|
|
\fIright-click\fR
|
|
.br
|
|
\fIdouble-click\fR
|
|
.br
|
|
or any single character
|
|
|
|
.SS AVAILABLE EVENTS:
|
|
\fIchange\fR
|
|
.RS
|
|
Triggered whenever the query string is changed
|
|
|
|
e.g.
|
|
\fB# Moves cursor to the top (or bottom depending on --layout) whenever the query is changed
|
|
fzf --bind change:top\fR
|
|
.RE
|
|
|
|
\fIbackward-eof\fR
|
|
.RS
|
|
Triggered when the query string is already empty and you try to delete it
|
|
backward.
|
|
|
|
e.g.
|
|
\fBfzf --bind backward-eof:abort\fR
|
|
.RE
|
|
|
|
.SS AVAILABLE ACTIONS:
|
|
A key or an event can be bound to one or more of the following actions.
|
|
|
|
\fBACTION: DEFAULT BINDINGS (NOTES):
|
|
\fBabort\fR \fIctrl-c ctrl-g ctrl-q esc\fR
|
|
\fBaccept\fR \fIenter double-click\fR
|
|
\fBaccept-non-empty\fR (same as \fBaccept\fR except that it prevents fzf from exiting without selection)
|
|
\fBbackward-char\fR \fIctrl-b left\fR
|
|
\fBbackward-delete-char\fR \fIctrl-h bspace\fR
|
|
\fBbackward-delete-char/eof\fR (same as \fBbackward-delete-char\fR except aborts fzf if query is empty)
|
|
\fBbackward-kill-word\fR \fIalt-bs\fR
|
|
\fBbackward-word\fR \fIalt-b shift-left\fR
|
|
\fBbeginning-of-line\fR \fIctrl-a home\fR
|
|
\fBcancel\fR (clear query string if not empty, abort fzf otherwise)
|
|
\fBchange-prompt(...)\fR (change prompt to the given string)
|
|
\fBclear-screen\fR \fIctrl-l\fR
|
|
\fBclear-selection\fR (clear multi-selection)
|
|
\fBclear-query\fR (clear query string)
|
|
\fBdelete-char\fR \fIdel\fR
|
|
\fBdelete-char/eof\fR \fIctrl-d\fR (same as \fBdelete-char\fR except aborts fzf if query is empty)
|
|
\fBdeselect-all\fR (deselect all matches)
|
|
\fBdown\fR \fIctrl-j ctrl-n down\fR
|
|
\fBend-of-line\fR \fIctrl-e end\fR
|
|
\fBexecute(...)\fR (see below for the details)
|
|
\fBexecute-silent(...)\fR (see below for the details)
|
|
\fBforward-char\fR \fIctrl-f right\fR
|
|
\fBforward-word\fR \fIalt-f shift-right\fR
|
|
\fBignore\fR
|
|
\fBjump\fR (EasyMotion-like 2-keystroke movement)
|
|
\fBjump-accept\fR (jump and accept)
|
|
\fBkill-line\fR
|
|
\fBkill-word\fR \fIalt-d\fR
|
|
\fBnext-history\fR (\fIctrl-n\fR on \fB--history\fR)
|
|
\fBpage-down\fR \fIpgdn\fR
|
|
\fBpage-up\fR \fIpgup\fR
|
|
\fBhalf-page-down\fR
|
|
\fBhalf-page-up\fR
|
|
\fBpreview(...)\fR (see below for the details)
|
|
\fBpreview-down\fR \fIshift-down\fR
|
|
\fBpreview-up\fR \fIshift-up\fR
|
|
\fBpreview-page-down\fR
|
|
\fBpreview-page-up\fR
|
|
\fBpreview-half-page-down\fR
|
|
\fBpreview-half-page-up\fR
|
|
\fBprevious-history\fR (\fIctrl-p\fR on \fB--history\fR)
|
|
\fBprint-query\fR (print query and exit)
|
|
\fBrefresh-preview\fR
|
|
\fBreload(...)\fR (see below for the details)
|
|
\fBreplace-query\fR (replace query string with the current selection)
|
|
\fBselect-all\fR (select all matches)
|
|
\fBtoggle\fR (\fIright-click\fR)
|
|
\fBtoggle-all\fR (toggle all matches)
|
|
\fBtoggle+down\fR \fIctrl-i (tab)\fR
|
|
\fBtoggle-in\fR (\fB--layout=reverse*\fR ? \fBtoggle+up\fR : \fBtoggle+down\fR)
|
|
\fBtoggle-out\fR (\fB--layout=reverse*\fR ? \fBtoggle+down\fR : \fBtoggle+up\fR)
|
|
\fBtoggle-preview\fR
|
|
\fBtoggle-preview-wrap\fR
|
|
\fBtoggle-sort\fR
|
|
\fBtoggle+up\fR \fIbtab (shift-tab)\fR
|
|
\fBtop\fR (move to the top result)
|
|
\fBunix-line-discard\fR \fIctrl-u\fR
|
|
\fBunix-word-rubout\fR \fIctrl-w\fR
|
|
\fBup\fR \fIctrl-k ctrl-p up\fR
|
|
\fByank\fR \fIctrl-y\fR
|
|
|
|
.SS ACTION COMPOSITION
|
|
|
|
Multiple actions can be chained using \fB+\fR separator.
|
|
|
|
e.g.
|
|
\fBfzf --multi --bind 'ctrl-a:select-all+accept'\fR
|
|
\fBfzf --multi --bind 'ctrl-a:select-all' --bind 'ctrl-a:+accept'\fR
|
|
|
|
.SS ACTION ARGUMENT
|
|
|
|
An action denoted with \fB(...)\fR suffix takes an argument.
|
|
|
|
e.g.
|
|
\fBfzf --bind 'ctrl-a:change-prompt(NewPrompt> )'\fR
|
|
\fBfzf --bind 'ctrl-v:preview(cat {})' --preview-window hidden\fR
|
|
|
|
If the argument contains parentheses, fzf may fail to parse the expression. In
|
|
that case, you can use any of the following alternative notations to avoid
|
|
parse errors.
|
|
|
|
\fBaction-name[...]\fR
|
|
\fBaction-name~...~\fR
|
|
\fBaction-name!...!\fR
|
|
\fBaction-name@...@\fR
|
|
\fBaction-name#...#\fR
|
|
\fBaction-name$...$\fR
|
|
\fBaction-name%...%\fR
|
|
\fBaction-name^...^\fR
|
|
\fBaction-name&...&\fR
|
|
\fBaction-name*...*\fR
|
|
\fBaction-name;...;\fR
|
|
\fBaction-name/.../\fR
|
|
\fBaction-name|...|\fR
|
|
\fBaction-name:...\fR
|
|
.RS
|
|
The last one is the special form that frees you from parse errors as it does
|
|
not expect the closing character. The catch is that it should be the last one
|
|
in the comma-separated list of key-action pairs.
|
|
.RE
|
|
|
|
.SS COMMAND EXECUTION
|
|
|
|
With \fBexecute(...)\fR action, you can execute arbitrary commands without
|
|
leaving fzf. For example, you can turn fzf into a simple file browser by
|
|
binding \fBenter\fR key to \fBless\fR command like follows.
|
|
|
|
\fBfzf --bind "enter:execute(less {})"\fR
|
|
|
|
You can use the same placeholder expressions as in \fB--preview\fR.
|
|
|
|
fzf switches to the alternate screen when executing a command. However, if the
|
|
command is expected to complete quickly, and you are not interested in its
|
|
output, you might want to use \fBexecute-silent\fR instead, which silently
|
|
executes the command without the switching. Note that fzf will not be
|
|
responsive until the command is complete. For asynchronous execution, start
|
|
your command as a background process (i.e. appending \fB&\fR).
|
|
|
|
.SS RELOAD INPUT
|
|
|
|
\fBreload(...)\fR action is used to dynamically update the input list
|
|
without restarting fzf. It takes the same command template with placeholder
|
|
expressions as \fBexecute(...)\fR.
|
|
|
|
See \fIhttps://github.com/junegunn/fzf/issues/1750\fR for more info.
|
|
|
|
e.g.
|
|
\fB# Update the list of processes by pressing CTRL-R
|
|
ps -ef | fzf --bind 'ctrl-r:reload(ps -ef)' --header 'Press CTRL-R to reload' \\
|
|
--header-lines=1 --layout=reverse
|
|
|
|
# Integration with ripgrep
|
|
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
|
|
INITIAL_QUERY="foobar"
|
|
FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \\
|
|
fzf --bind "change:reload:$RG_PREFIX {q} || true" \\
|
|
--ansi --phony --query "$INITIAL_QUERY"\fR
|
|
|
|
.SS PREVIEW BINDING
|
|
|
|
With \fBpreview(...)\fR action, you can specify multiple different preview
|
|
commands in addition to the default preview command given by \fB--preview\fR
|
|
option.
|
|
|
|
e.g.
|
|
|
|
# Default preview command with an extra preview binding
|
|
fzf --preview 'file {}' --bind '?:preview:cat {}'
|
|
|
|
# A preview binding with no default preview command
|
|
# (Preview window is initially empty)
|
|
fzf --bind '?:preview:cat {}'
|
|
|
|
# Preview window hidden by default, it appears when you first hit '?'
|
|
fzf --bind '?:preview:cat {}' --preview-window hidden
|
|
|
|
.SH AUTHOR
|
|
Junegunn Choi (\fIjunegunn.c@gmail.com\fR)
|
|
|
|
.SH SEE ALSO
|
|
.B Project homepage:
|
|
.RS
|
|
.I https://github.com/junegunn/fzf
|
|
.RE
|
|
.br
|
|
|
|
.br
|
|
.B Extra Vim plugin:
|
|
.RS
|
|
.I https://github.com/junegunn/fzf.vim
|
|
.RE
|
|
|
|
.SH LICENSE
|
|
MIT
|