generated from leo-arch/fzy
-
Notifications
You must be signed in to change notification settings - Fork 3
/
fnf.1
181 lines (178 loc) · 4.49 KB
/
fnf.1
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
.TH FNF 1 "Jun 6, 2023" "fnf 0.1"
.SH NAME
fnf \- A simple fuzzy finder for the terminal.
.SH SYNOPSIS
.B fnf
.IR [OPTION]...
.SH DESCRIPTION
\fBFnf\fR is a fuzzy finder for the terminal using a search
similar to that of TextMate or CmdT.
\fBFnf\fR reads a list of newline-separated items from stdin to be displayed as a
menu in the terminal.
Upon pressing ENTER, the currently selected item is printed to stdout.
Entering text narrows the items using fuzzy matching. Results are sorted using
heuristics for the best match.
.SH OPTIONS
.TP
.BR \-l ", " \-\-lines =\fILINES\fR
How many lines of items to display (set to 'auto' to use the entire terminal screen). If unspecified, it defaults to 10 lines.
.
.TP
.BR \-p ", " \-\-prompt =\fIPROMPT\fR
Input prompt (default: '> ')
.
.TP
.BR \-P ", " \-\-pad =\fINUM\fR
Left pad the list of matches NUM places (default: 0)
.
.TP
.BR \-m ", " \-\-multi
Enable multi-selection
.
.TP
.BR \-s ", " \-\-show-scores
Show the scores for each item.
.
.TP
.BR \-t ", " \-\-tty =\fITTY\fR
Use TTY instead of the default tty device (/dev/tty).
.
.TP
.BR \-q ", " \-\-query =\fIQUERY\fR
Use QUERY as the initial search query.
.
.TP
.BR \-e ", " \-\-show-matches =\fIQUERY\fR
Non-interactive mode. Print the matches in sorted order for QUERY to stdout.
.
.TP
.BR \-0 ", " \-\-read-null
Read input delimited by ASCII NUL characters.
.
.TP
.BR \-h ", " \-\-help
Print help and exit.
.
.TP
.BR \-v ", " \-\-version
Print version and exit.
.
.TP
.BR \-\-pointer =\fICHAR\fR
Pointer to highlightled match (default '>')
.
.TP
.BR \-\-marker =\fICHAR\fR
Multi-select marker (default '*')
.
.TP
.BR \-\-cyclic
Enable cyclic scrolling
.
.TP
.BR \-\-tab-accetps
TAB accepts: print selection and exit
.
.TP
.BR \-\-right-accepts
Right arrow key accepts: print selection and exit
.
.TP
.BR \-\-left-aborts
Left arrow key aborts: cancel selection and exit
.
.TP
.BR \-\-reverse
List from top, prompt at bottom
.
.TP
.BR \-\-no\-color
Run colorless
.
.SH KEYS
.
.TP
.BR "ENTER"
Print the selected items to stdout and exit. If \fI\-\-right\-accepts\fR is set, the Right arrow key performs the same function. Equally, if \fI\-\-tab\-accepts\fR is set, the TAB key performs the same function.
.TP
.BR "ESC"
Exit without printing any result. If \fI\-\-left\-aborts\fR is set, the Left arrow key performs the same function.
.TP
.BR "Ctrl+c, Ctrl+g, Esc"
Exit with status 1, without making a selection.
.TP
.BR "Up Arrow, Ctrl+p, Ctrl+k"
Select the previous item.
.TP
.BR "Down Arrow, Ctrl+n, Ctrl+j"
Select the next item.
.TP
.BR "TAB"
Replace the current search string with the selected item. If the multi-selection mode (\fI-m, --multi\fR) is enabled, TAB is used to (un)mark the selected entry instead.
.TP
.BR "Backspace, Ctrl+h"
Delete the character before the cursor.
.TP
.BR Ctrl+w
Delete the word before the cursor.
.TP
.BR Ctrl+u
Delete the entire line.
.
.SH COLORS
Interface colors are read from the environment variable \fBFNF_COLORS\fR using a simple pattern: the \fIorder\fR of the color code specifies which \fIinterface element\fR the color must be applied to, while the \fIcontent\fR of this code defines the \fIcolor\fR of this element.
.sp
\fBA\fR. The order is this:
1) Prompt
2) Pointer
3) Marker
4) Current entry foreground
5) Current entry background
.sp
\fBB\fR. Possible content (available colors):
0 = black
1 = red
2 = green
3 = yellow
4 = blue
5 = magenta
6 = cyan
7 = white
.sp
Use a \fBb\fR before the color to make it bold/bright. A dash (\-) means that the color for the interface element in that position must be skipped.
.sp
For example, \fBFZF_COLORS="\-b1b2\-4"\fR is to be read as follows:
.sp
\fB\-\fR: no prompt color
\fBb1\fR: bold red pointer color
\fBb2\fR: bold green marker color
\fB\-\fR: no color for the current entry foreground
\fB4\fR: blue current entry background
.sp
Default colors are: \fBb6b1b2b40\fR
.
.SH USAGE EXAMPLES
.
.TP
.BR "ls | fnf"
Present a menu of items in the current directory
.TP
.BR "ls | fnf \-l 25"
Same as above, but show 25 lines of items
.TP
.BR "vi $(find \-type f | fnf)"
List files under the current directory and open the one selected in vi.
.TP
.BR "cd $(find \-type d | fnf)"
Present all directories under current path, and change to the one selected.
.TP
.BR "ps aux | fnf | awk '{ print $2 }' | xargs kill"
List running processes, kill the selected process
.TP
.BR "git checkout $(git branch | cut \-c 3\- | fnf)"
Same as above, but switching git branches.
.SH AUTHORS
.sp
John Hawthorn <[email protected]> 2014-2022
.sp 0
L. Abramovich <[email protected]> 2022-today