summaryrefslogtreecommitdiffstats
path: root/man/man1/fzf.1
blob: 1448eb95cc16b703209a69b42d44e72d87d522aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
.ig
The MIT License (MIT)

Copyright (c) 2015 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 "June 2015" "fzf 0.10.0" "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
.TP
.B "-e, --extended-exact"
Extended-search mode (exact match)
.TP
.B "-i"
Case-insensitive match (default: smart-case match)
.TP
.B "+i"
Case-sensitive match
.TP
.BI "-n, --nth=" "N[,..]"
Comma-separated list of field index expressions for limiting search scope.
See \fBFIELD INDEX EXPRESSION\fR for details.
.TP
.BI "--with-nth=" "N[,..]"
Transform each item using index expressions within finder
.TP
.BI "-d, --delimiter=" "STR"
Field delimiter regex for \fB--nth\fR and \fB--with-nth\fR (default: AWK-style)
.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"
Sort criterion to use when the scores are tied
.br
.R ""
.br
.BR length "  Prefers item with shorter length"
.br
.BR begin "   Prefers item with matched substring closer to the beginning"
.br
.BR end "     Prefers item with matched substring closer to the end"
.br
.BR index "   Prefers item that appeared earlier in the input stream"
.br
.SS Interface
.TP
.B "-m, --multi"
Enable multi-select with tab/shift-tab
.TP
.B "--ansi"
Enable processing of ANSI color codes
.TP
.B "--no-mouse"
Disable mouse
.TP
.BI "--color=" "[BASE_SCHEME][,COLOR:ANSI]"
Color configuration. The name of the base color scheme is followed by custom
color mappings. Ansi color code of -1 denotes terminal default
foreground/background color.

.RS
e.g. \fBfzf --color=bg+:24\fR
     \fBfzf --color=light,fg:232,bg:255,bg+:116,info:27\fR
.RE

.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

.B COLOR:
    \fBfg      \fRText
    \fBbg      \fRBackground
    \fBhl      \fRHighlighted substrings
    \fBfg+     \fRText (current line)
    \fBbg+     \fRBackground (current line)
    \fBhl+     \fRHighlighted substrings (current line)
    \fBinfo    \fRInfo
    \fBprompt  \fRPrompt
    \fBpointer \fRPointer to the current line
    \fBmarker  \fRMulti-select marker
    \fBspinner \fRStreaming input indicator
    \fBheader  \fRHeader
.RE
.TP
.B "--black"
Use black background
.TP
.B "--reverse"
Reverse orientation
.TP
.BI "--margin=" MARGIN
Comma-separated expression for margins around the finder.
.br
.R ""
.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
.R ""
.br
Each part can be given in absolute number or in percentage relative to the
terminal size with \fB%\fR suffix.
.br
.R ""
.br
e.g. \fBfzf --margin 10%\fR
     \fBfzf --margin 1,5%\fR
.RE
.TP
.B "--cycle"
Enable cyclic scroll
.TP
.B "--no-hscroll"
Disable horizontal scroll
.TP
.B "--inline-info"
Display finder info inline with the query
.TP
.BI "--prompt=" "STR"
Input prompt (default: '> ')
.TP
.BI "--toggle-sort=" "KEY"
Key to toggle sort. For the list of the allowed key names, see \fB--bind\fR.
.TP
.BI "--bind=" "KEYBINDS"
Comma-separated list of custom key bindings. Each key binding expression
follows the following format: \fBKEY:ACTION\fR
.RS
e.g. \fBfzf --bind=ctrl-j:accept,ctrl-k:kill-line\fR
.RE

.RS
.B AVAILABLE KEYS:
    \fIctrl-[a-z]\fR
    \fIalt-[a-z]\fR
    \fIf[1-4]\fR
    \fIenter\fR       (\fIreturn\fR)
    \fIspace\fR
    \fIbspace\fR      (\fIbs\fR)
    \fIalt-bspace\fR  (\fIalt-bs\fR)
    \fItab\fR
    \fIbtab\fR        (\fIshift-tab\fR)
    \fIesc\fR
    \fIdel\fR
    \fIup\fR
    \fIdown\fR
    \fIleft\fR
    \fIright\fR
    \fIhome\fR
    \fIend\fR
    \fIpgup\fR        (\fIpage-up\fR)
    \fIpgdn\fR        (\fIpage-down\fR)
    \fIshift-left\fR
    \fIshift-right\fR
    or any single character
.RE

.RS
  \fBACTION:               DEFAULT BINDINGS:
    \fBabort\fR                 \fIctrl-c  ctrl-g  ctrl-q  esc\fR
    \fBaccept\fR                \fIctrl-m  (enter)\fR
    \fBbackward-char\fR         \fIctrl-b  left\fR
    \fBbackward-delete-char\fR  \fIctrl-h  bspace\fR
    \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
    \fBclear-screen\fR          \fIctrl-l\fR
    \fBdelete-char\fR           \fIdel\fR
    \fBdelete-char/eof\fR       \fIctrl-d\fR
    \fBdeselect-all\fR
    \fBdown\fR                  \fIctrl-j  ctrl-n  down\fR
    \fBend-of-line\fR           \fIctrl-e  end\fR
    \fBexecute(...)\fR          (see below for the details)
    \fBforward-char\fR          \fIctrl-f  right\fR
    \fBforward-word\fR          \fIalt-f   shift-right\fR
    \fBignore\fR
    \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
    \fBprevious-history\fR      (\fIctrl-p\fR on \fB--history\fR)
    \fBselect-all\fR
    \fBtoggle\fR
    \fBtoggle-all\fR
    \fBtoggle-down\fR           \fIctrl-i  (tab)\fR
    \fBtoggle-sort\fR           (equivalent to \fB--toggle-sort\fR)
    \fBtoggle-up\fR             \fIbtab    (shift-tab)\fR
    \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
.RE

.RS
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.

.RS
\fBfzf --bind "enter:execute(less {})"\fR
.RE

\fB{}\fR is the placeholder for the double-quoted string of the current line.
If the command contains parentheses, you can use any of the following
alternative notations to avoid parse errors.

    \fBexecute[...]\fR
    \fBexecute~...~\fR
    \fBexecute!...!\fR
    \fBexecute@...@\fR
    \fBexecute#...#\fR
    \fBexecute$...$\fR
    \fBexecute%...%\fR
    \fBexecute^...^\fR
    \fBexecute&...&\fR
    \fBexecute*...*\fR
    \fBexecute;...;\fR
    \fBexecute/.../\fR
    \fBexecute|...|\fR
    \fBexecute:...\fR
.RS
This 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.
.RE
.RE
.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.
.TP
.BI "--header-file=" "FILE"
The content of the file will be printed as the sticky header. The lines in the
file are displayed in order from top to bottom regardless of \fB--reverse\fR,
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 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.
.RS
e.g. \fBfzf --expect=ctrl-v,ctrl-t,alt-s,f1,f2,~,@\fR
.RE
.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

.SH ENVIRONMENT
.TP
.B FZF_DEFAULT_COMMAND
Default command to use when input is tty
.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 "      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

With \fB-x\fR or \fB--extended\fR option, 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

.SS Exact-match (quoted)
A term that is prefixed by a single-quote character (') is interpreted as an
"exact-match" (or "non-fuzzy") term. fzf will search for the exact occurrences
of the string.

.SS Anchored-match
A term can be prefixed by ^, or suffixed by $ to become an anchored-match term.
Then fzf will search for the items 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 !, fzf will exclude the items that satisfy the term
from the result.

.SS Extended-exact mode
If you don't need fuzzy matching at all and do not wish to "quote" (prefixing
with ') every word, start fzf with \fB-e\fR or \fB--extended-exact\fR option
(instead of \fB-x\fR or \fB--extended\fR).

.SH AUTHOR
Junegunn Choi (\fIjunegunn.c@gmail.com\fR)

.SH SEE ALSO
.I https://github.com/junegunn/fzf

.SH LICENSE
MIT