X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=selector.git;a=blobdiff_plain;f=selector.1;h=0446d14780497b102fa18fe0ea6e39456fa801ad;hp=bc83e454e9af0286bd19e702ce8d071ad95c758f;hb=79409fb064b188b5da9cbe4ea39529eadcad8eb0;hpb=683fae45816f0a0118a94cef7e546b7566c29dd9 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