Added a note about the readline like shortcuts.
[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] -f <filename>
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.
16
17 The main usage of selector is as an efficient search in the shell
18 command history. With the correct option, it will inject the selected
19 line into the virtual tty input buffer, hence allowing the user to
20 edit the line and execute it as a standard command.
21
22 Keys corresponding to ASCII codes between ' ' and '~' add a character
23 to the pattern string. The Delete key, Backspace key, ^D and ^H delete
24 one character from the pattern string.
25
26 The Up and Down cursor keys move the selected line accordingly, and
27 PageUp and PageDown move by ten lines. The Home and End key move to
28 the top and the bottom of the list respectively. The return key
29 selects the current line and exits.
30
31 The shortcuts ^A, ^E, ^U, and ^K do somehow what they do in readline,
32 and you can cancel the selection by either interrupting the command
33 with ^C or by typing ^G.
34
35 .SH "OPTIONS"
36 .IP "\fB-h\fP" 10
37 display help and exits
38 .IP "\fB-m\fP" 10
39 force the monochrome mode
40 .IP "\fB-i\fP" 10
41 inverse the order of the lines
42 .IP "\fB-b\fP" 10
43 remove the numeric prefix from bash history
44 .IP "\fB-z\fP" 10
45 remove the time prefix from zsh history
46 .IP "\fB-d\fP" 10
47 remove duplicated lines
48 .IP "\fB-e\fP" 10
49 start with the regexp mode activated
50 .IP "\fB-a\fP" 10
51 make the matching case sensitive
52 .IP "\fB-t <title>\fP" 10
53 add a title in the modeline
54 .IP "\fB-c <fg modeline> <bg modeline> <fg highlight> <bg highlight>\fP" 10
55 select the modeline and highlight color numbers
56 .IP "\fB-v\fP" 10
57 inject the selected line into the tty input buffer
58 .IP "\fB-o <output filename>\fP" 10
59 write the selected line into the specified file
60 .IP "\fB-s <pattern separator>\fP" 10
61 specify the symbol to separate the substrings in the search pattern
62 .IP "\fB-l <max number of lines>\fP" 10
63 specify the maximum number of lines to take into account
64 .IP "\fB-f <input filename>\fP" 10
65 specify the file to search into
66
67 .SH "EXAMPLES"
68
69 To use selector to search into your bash history, you can use
70
71 .B selector -d -i -b -v -f <(history)
72
73 .SH "BUGS"
74
75 Probably many.
76
77 .SH "AUTHOR"
78 .PP
79 Written by Francois Fleuret <francois@fleuret.org>. Permission is
80 granted to copy, distribute and/or modify this document under the
81 terms of the GNU GPL.