Typo.
[selector.git] / selector.1
1 .TH "SELECTOR" "1"
2 .SH "NAME"
3 selector - A simple command line utility 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 utility for dynamic string
10 selection. As you type a list of strings separated by ';' or a regexp,
11 the display is updated in real time to show only the lines containing
12 all the said strings, or matching the regexp.
13
14 The main usage of selector is as an efficient search in the shell
15 command history. With the correct option, it will inject the selected
16 line into the virtual tty input buffer, hence allowing the user to
17 edit the line and execute it as a standard command.
18
19 Selector is also a good tool to test regexps.
20
21 .SH "KEYS"
22 .PP
23
24 Keys corresponding to ASCII codes between ' ' and '~' add a character
25 to the pattern string. The Backspace key, ^H and ^? delete the
26 character immediately on the left of the cursor, while the Delete key
27 and ^D delete the character at cursor location.
28
29 The Up and Down cursor keys move the selected line accordingly, and
30 PageUp and PageDown move by ten lines. The Home and End key move to
31 the top and the bottom of the list respectively. The return key
32 selects the current line and exits.
33
34 The shortcuts ^A, ^E, ^U, and ^K do somehow what they do in readline,
35 and you can exit selector without doing anything by either
36 interrupting the command with ^C or by typing ^G.
37
38 The ^R key switches between the standard multi-substring mode and the
39 regexp mode, and ^I between the case-sensitive and case-insensitive
40 modes.
41
42 .SH "OPTIONS"
43 .IP "\fB-h\fP" 10
44 display help and exits
45 .IP "\fB-m\fP" 10
46 force the monochrome mode
47 .IP "\fB-i\fP" 10
48 inverse the order of the lines
49 .IP "\fB-b\fP" 10
50 remove the numeric prefix from bash history
51 .IP "\fB-z\fP" 10
52 remove the time prefix from zsh history
53 .IP "\fB-d\fP" 10
54 remove duplicated lines
55 .IP "\fB-e\fP" 10
56 start with the regexp mode activated
57 .IP "\fB-a\fP" 10
58 make the matching case sensitive
59 .IP "\fB-q\fP" 10
60 make a flash instead of a beep when there is an edition error
61 .IP "\fB--\fP" 10
62 state that all following arguments are filenames
63 .IP "\fB-t <title>\fP" 10
64 add a title in the modeline
65 .IP "\fB-c <fg modeline> <bg modeline> <fg highlight> <bg highlight>\fP" 10
66 select the modeline and highlight color numbers
67 .IP "\fB-v\fP" 10
68 inject the selected line into the tty input buffer
69 .IP "\fB-o <output filename>\fP" 10
70 write the selected line into the specified file
71 .IP "\fB-s <pattern separator>\fP" 10
72 specify the symbol to separate the substrings in the search pattern
73 .IP "\fB-l <max number of lines>\fP" 10
74 specify the maximum number of lines to take into account
75 .IP "\fB-f <input filename>\fP" 10
76 specify a file to search into (option kept for compatibility reasons)
77
78 .SH "EXAMPLES"
79
80 To use selector to search into your bash history, you can use
81
82 .B selector -d -i -b -v <(history)
83
84 .SH "INTERACTION WITH READLINE"
85
86 For better efficiency, you can associate selector to a key in the
87 shell through the use of the readline configuration file. To do so,
88 you have first to pick a key and check the character sequence
89 associated to it.
90
91 You can do that by typing at the console prompt Control-q followed by
92 the key you want to use. For instance, if you want to use Alt-r, you
93 may get ^[r. Then, you have to add in the readline configuration file
94 ~/.inputrc the following:
95
96 "^[r": "^A^K selector -q -b -i -d -v -l 10000 <(history)^M"
97
98 Note that you have to put the actual control characters in the
99 configuration file, not a '^' followed by a character. To do so with
100 Emacs for instance, you have to use the C-q key followed by another
101 key: C-q C-a inserts "^A", C-q C-[ inserts "^[", etc.
102
103 The control characters in this line are here to first erase the
104 current line content and to simulate the enter key.
105
106 .SH "BUGS"
107
108 There are modeline display problems if the pattern is too
109 long.
110
111 .SH "AUTHOR"
112 .PP
113 Written by Francois Fleuret <francois@fleuret.org>. Permission is
114 granted to copy, distribute and/or modify this document under the
115 terms of the GNU GPL.