Fixed the \n at the beginning.
[selector.git] / selector.1
index 4be2622..35ffaa2 100644 (file)
@@ -1,9 +1,9 @@
+.TH "SELECTOR" 1 "July 2009" "Francois Fleuret" "User Commands"
+
 \" This man page was written by Francois Fleuret <francois@fleuret.org>
 \" and is distributed under a Creative Commons Attribution-Share Alike
 \" 3.0 License.
 
-.TH "SELECTOR" 1 "July 2009" "Francois Fleuret" "User Commands"
-
 .SH "NAME"
 
 selector \- A simple command line utility for dynamic pattern selection
@@ -60,13 +60,13 @@ case-insensitive modes.
 .SH "OPTIONS"
 .TP
 \fB-h\fR
-display help and exits
+display help and exit
 .TP
 \fB-m\fR
 force the monochrome mode
 .TP
 \fB-i\fR
-invert the order of the lines
+revert the order of the lines
 .TP
 \fB-b\fR
 remove the numeric prefix from bash history
@@ -118,12 +118,23 @@ specify the maximum number of lines to take into account
 \fB-f \fI<input_filename>\fR
 specify a file to search into (option kept for compatibility reasons)
 
-.SH "EXAMPLE"
+.SH "EXAMPLES"
 
-To use selector to search into your bash history, you can use
+To use selector to search into your bash history
 
 .B selector -q -b -i -d -v -w -l ${HISTSIZE} <(history)
 
+To show a list of directories and insert a cd command to the selected
+one (using @ as a separator)
+
+.B selector -v -x @ <(find . -type d | awk \(aq{print $0\(dq@cd \(dq$0}\(aq)
+
+To select a line in a long text and returns the line number (this
+command uses ^A as a separator, hence there will be problems if the
+file contains ^A)
+
+.B selector -v -x ^A <(awk < something.txt \(aq{ print $0\(dq^A\(dqNR }\(aq)
+
 .SH "KEYBINDING IN BASH"
 
 You can associate selector to a single key in bash by using the
@@ -131,19 +142,19 @@ command 'bind' in your bash initialization file. For instance, to
 associate it to M-r (that is, the "Alt" and "r" key pressed together),
 just add something like
 
-bind '"\\C-[r":"\\C-a\\C-kselector -q -b -i -d -v -w -l ${HISTSIZE} <(history)\\C-m"'
+bind \(aq\(dq\\C-[r\(dq:\(dq\\C-a\\C-kselector -q -b -i -d -v -w -l ${HISTSIZE} <(history)\\C-m\(dq\(aq
 
 in your
 .IR ~/.bashrc .
 
+This bindings uses the control character ^A to put the cursor to the
+mostleft location and ^K to erase the current content of the readline
+buffer, and it simulates the enter key with ^M.
+
 Note that depending on the configuration of your system, the sequence
 associated to the M-r key, which is here "C-[r", may differ. To figure
 it out, simply press C-q followed by M-r in the console.
 
-The control character "C-a" puts the cursor to the mostleft location,
-"C-k" erases the current content of the readline buffer, and "C-m"
-simulates the enter key.
-
 .SH "BUGS"
 
 There are modeline display problems if the pattern is too long. This
@@ -151,8 +162,8 @@ program does not handle multibyte characters.
 
 .SH "AUTHOR"
 
-The selector command was written by Francois Fleuret
-<francois@fleuret.org> and is distributed under the terms of the GNU
-General Public License version 3 as published by the Free Software
-Foundation. This is free software: you are free to change and
-redistribute it. There is NO WARRANTY, to the extent permitted by law.
+Written by Francois Fleuret <francois@fleuret.org> and distributed
+under the terms of the GNU General Public License version 3 as
+published by the Free Software Foundation. This is free software: you
+are free to change and redistribute it. There is NO WARRANTY, to the
+extent permitted by law.