2013-12-25 22:25:36 +08:00
|
|
|
.TH HH 1
|
|
|
|
.SH NAME
|
2014-01-17 11:46:12 +08:00
|
|
|
\fBhh\fR \- shell history suggest box
|
2013-12-25 22:25:36 +08:00
|
|
|
.SH SYNOPSIS
|
2014-01-17 11:54:54 +08:00
|
|
|
.B hh [option] [arg1] [arg2]...
|
2013-12-25 22:25:36 +08:00
|
|
|
.SH DESCRIPTION
|
|
|
|
.B hh
|
|
|
|
uses shell history to provide suggest box like functionality
|
|
|
|
for commands used in the past. By default it parses .bash-history
|
|
|
|
file that is filtered as you type a command substring. Commands
|
|
|
|
are not just filtered, but also ordered by a ranking algorithm
|
|
|
|
that considers number of occurences, length and timestamp. In addition
|
|
|
|
hh allows removal of commands from history - for instance with a typo or with a sensitive content.
|
2014-01-17 11:46:12 +08:00
|
|
|
.SH OPTIONNS
|
|
|
|
.TP
|
|
|
|
\fB--show-configuration\fR
|
|
|
|
Show configuration to be added to .bashrc
|
2013-12-25 22:25:36 +08:00
|
|
|
.SH COMMANDS
|
|
|
|
.TP
|
2014-01-19 04:45:37 +08:00
|
|
|
\fBpattern\fR
|
2013-12-25 22:25:36 +08:00
|
|
|
Type to filter shell history.
|
2014-01-04 15:39:03 +08:00
|
|
|
.TP
|
2014-01-19 05:08:46 +08:00
|
|
|
\fBCtrl\-t\fR
|
2014-01-04 15:39:03 +08:00
|
|
|
Toggle case sensitive search.
|
2014-01-05 23:49:08 +08:00
|
|
|
.TP
|
|
|
|
\fBCtrl\-h\fR
|
2014-01-07 14:17:28 +08:00
|
|
|
Toggle history as provided by shell vs. ranked history ordered by the number of occurences, length and timestamp.
|
2013-12-25 22:25:36 +08:00
|
|
|
.TP
|
2014-01-20 15:04:28 +08:00
|
|
|
\fBCtrl\-r\fR, \fBUP\fR arrow, \fBDOWN\fR arrow
|
2014-01-07 14:19:10 +08:00
|
|
|
Navigate in the history list.
|
2013-12-25 22:25:36 +08:00
|
|
|
.TP
|
2014-01-20 15:04:28 +08:00
|
|
|
\fBTAB\fR, \fBLEFT\fR arrow, \fBRIGHT\fR arrow,
|
2014-01-19 04:45:37 +08:00
|
|
|
Choose currently selected item for completion and let user to edit it on the command prompt.
|
|
|
|
.TP
|
2013-12-25 22:25:36 +08:00
|
|
|
\fBENTER\fR
|
2014-01-19 04:45:37 +08:00
|
|
|
Choose currently selected item for completion and execute it.
|
2013-12-25 22:25:36 +08:00
|
|
|
.TP
|
2014-01-19 15:57:45 +08:00
|
|
|
\fBDEL\fR
|
2013-12-25 22:25:36 +08:00
|
|
|
Remove currently selected item from the shell history.
|
|
|
|
.TP
|
|
|
|
\fBCtrl\-x\fR
|
|
|
|
Write changes to shell history and exit.
|
2014-01-19 04:45:37 +08:00
|
|
|
.TP
|
|
|
|
\fBCtrl\-g\fR
|
|
|
|
Exit with empty prompt.
|
2013-12-25 22:25:36 +08:00
|
|
|
.SH INSTALLATION
|
|
|
|
Add the following lines to ~/.bashrc:
|
|
|
|
.nf
|
|
|
|
.sp
|
|
|
|
shopt -s histappend
|
|
|
|
export PROMPT_COMMAND="history \-a; history \-n; ${PROMPT_COMMAND}"
|
2014-01-21 06:48:51 +08:00
|
|
|
bind '"\eC\-r": "\eC\-a hh \eC-j"'
|
2013-12-25 22:25:36 +08:00
|
|
|
.sp
|
|
|
|
.fi
|
2014-01-17 11:54:54 +08:00
|
|
|
The first command ensures that new history items are appended to .bash_history
|
|
|
|
(instead of overwriting). The second command ensures synchronization of the
|
|
|
|
history between memory and file system. The third command binds hh to
|
|
|
|
Ctrl-r shortcut.
|
2013-12-25 22:25:36 +08:00
|
|
|
.SH AUTHOR
|
|
|
|
Written by Martin Dvorak <martin.dvorak@mindforger.com>
|
|
|
|
.SH BUGS
|
|
|
|
Report bugs to https://github.com/dvorka/hstr/issues
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR history (1),
|
|
|
|
.BR bash (1)
|