Added the ^I keystroke to switch the case-sensitivity. Added a check
[selector.git] / selector.1
1 .TH "SELECTOR" "1"
2 .SH "NAME"
3 selector - A simple command line for dynamic pattern selection
4 .SH "SYNOPSIS"
5 .PP
6 \fBselector\fP [\fBoptions\fP] [<filename1> [<filename2> ...]]
7 .SH "DESCRIPTION"
8 .PP
9 \fBselector\fP is a command line dynamic string selection. As you type
10 a list of strings separated by ';' or a regexp, the display is updated
11 in real time to show only the lines containing all the said strings,
12 or matching the regexp.
13
14 The ^R key switches between the standard multi-substring mode and the
15 regexp mode, and ^I between the case-sensitive and case-insensitive
16 modes.
17
18 The main usage of selector is as an efficient search in the shell
19 command history. With the correct option, it will inject the selected
20 line into the virtual tty input buffer, hence allowing the user to
21 edit the line and execute it as a standard command.
22
23 Selector is also a good tool to test regexp quickly.
24
25 Keys corresponding to ASCII codes between ' ' and '~' add a character
26 to the pattern string. The Backspace key, ^H and ^? delete the
27 character on the left of the cursor, while Delete key and ^D delete
28 the character at cursor location.
29
30 The Up and Down cursor keys move the selected line accordingly, and
31 PageUp and PageDown move by ten lines. The Home and End key move to
32 the top and the bottom of the list respectively. The return key
33 selects the current line and exits.
34
35 The shortcuts ^A, ^E, ^U, and ^K do somehow what they do in readline,
36 and you can cancel the selection by either interrupting the command
37 with ^C or by typing ^G.
38
39 .SH "OPTIONS"
40 .IP "\fB-h\fP" 10
41 display help and exits
42 .IP "\fB-m\fP" 10
43 force the monochrome mode
44 .IP "\fB-i\fP" 10
45 inverse the order of the lines
46 .IP "\fB-b\fP" 10
47 remove the numeric prefix from bash history
48 .IP "\fB-z\fP" 10
49 remove the time prefix from zsh history
50 .IP "\fB-d\fP" 10
51 remove duplicated lines
52 .IP "\fB-e\fP" 10
53 start with the regexp mode activated
54 .IP "\fB-a\fP" 10
55 make the matching case sensitive
56 .IP "\fB--\fP" 10
57 state that all following arguments are filenames
58 .IP "\fB-t <title>\fP" 10
59 add a title in the modeline
60 .IP "\fB-c <fg modeline> <bg modeline> <fg highlight> <bg highlight>\fP" 10
61 select the modeline and highlight color numbers
62 .IP "\fB-v\fP" 10
63 inject the selected line into the tty input buffer
64 .IP "\fB-o <output filename>\fP" 10
65 write the selected line into the specified file
66 .IP "\fB-s <pattern separator>\fP" 10
67 specify the symbol to separate the substrings in the search pattern
68 .IP "\fB-l <max number of lines>\fP" 10
69 specify the maximum number of lines to take into account
70 .IP "\fB-f <input filename>\fP" 10
71 specify a file to search into (option kept for compatibility reasons)
72
73 .SH "EXAMPLES"
74
75 To use selector to search into your bash history, you can use
76
77 .B selector -d -i -b -v <(history)
78
79 .SH "BUGS"
80
81 Modeline display problems if the pattern is too long. Probably many
82 others.
83
84 .SH "AUTHOR"
85 .PP
86 Written by Francois Fleuret <francois@fleuret.org>. Permission is
87 granted to copy, distribute and/or modify this document under the
88 terms of the GNU GPL.