From 79409fb064b188b5da9cbe4ea39529eadcad8eb0 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Mon, 24 Oct 2011 22:51:23 +0200 Subject: [PATCH] Added a short explanation for the new bash-selector.sh. --- selector.1 | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/selector.1 b/selector.1 index bc83e45..0446d14 100644 --- a/selector.1 +++ b/selector.1 @@ -1,4 +1,4 @@ -.TH "SELECTOR" "1.1.4" "June 2011" "Francois Fleuret" "User Commands" +.TH "SELECTOR" "1.1.4" "October 2011" "Francois Fleuret" "User Commands" \" This man page was written by Francois Fleuret \" and is distributed under a Creative Commons Attribution-Share Alike @@ -131,6 +131,18 @@ selection from the line to return \fB-l \fI\fR, \fB--number-of-lines \fI\fR specify the maximum number of lines to take into account +.SH "USAGE WITH BASH" + +The selector command comes with a shell script for bash. If you add + +.B . bash-selector.sh + +in your +.IR ~/.bashrc +(do not forget the dot before the command name), it will remap M-r to +the smart history search, and redefine cd to have M-c provide a smart +cd history. + .SH "EXAMPLES" To use selector to search into your bash history @@ -148,26 +160,6 @@ 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 -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 \(aq\(dq\\C-[r\(dq:\(dq\\C-a\\C-kselector --bash <(history)\\C-m\(dq\(aq - -in your -.IR ~/.bashrc . - -This binding 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. - .SH "BUGS" There are modeline display problems if the pattern is too long. This -- 2.39.5