xaizek / hstr (License: Apachev2) (since 2018-12-07)
Bash and Zsh shell history suggest box - easily view, navigate, search and manage your command history.
<root> / man / hh.1 (d9b39727bbb96fa4985cd4d3fd855692da1506a4) (2,883B) (mode 100644) [raw]
.TH HH 1
.SH NAME
\fBhh\fR \- shell history suggest box
.SH SYNOPSIS
.B hh [option] [arg1] [arg2]...
.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.
.SH OPTIONS
.TP 
\fB--show-configuration\fR
Show configuration to be added to .bashrc
.TP 
\fB--help\fR
Show help
.SH COMMANDS
.TP 
\fBpattern\fR
Type to filter shell history.
.TP 
\fBCtrl\-t\fR
Toggle case sensitive search.
.TP 
\fBCtrl\-/\fR
Toggle history as provided by shell vs. ranked history ordered by the number of occurences, length and timestamp.
.TP 
\fBCtrl\-l\fR
Make search pattern lowercase or uppercase.	
.TP
\fBCtrl\-r\fR, \fBUP\fR arrow, \fBDOWN\fR arrow
Navigate in the history list. 
.TP
\fBTAB\fR, \fBLEFT\fR arrow, \fBRIGHT\fR arrow,
Choose currently selected item for completion and let user to edit it on the command prompt.
.TP
\fBENTER\fR
Choose currently selected item for completion and execute it.
.TP 
\fBDEL\fR
Remove currently selected item from the shell history.
.TP
\fBBACSKSPACE\fR, \fBCtrl\-h\fR
Delete last pattern character.
.TP
\fBCtrl\-u\fR, \fBCtrl\-w\fR
Delete pattern and search again.
.TP
\fBCtrl\-x\fR
Write changes to shell history and exit.
.TP
\fBCtrl\-g\fR
Exit with empty prompt.
.SH ENVIRONMENT VARIABLES
\fBhh\fR defines the following environment variables:
.TP
\fBHH_CONFIG\fR
Configuration options. \fBhh\fR is monochromatic by default - use \fBhicolor\fR to get more colors.
Make the pattern-based filtering case sensitive using \fBcasesensitive\fR. Force raw history view instead
of metric-based one using \fBrawhistory\fR. Example:
.nf
.sp
export HH_CONFIG=casesensitive,hicolor         # color version with case sensitive search
.sp
.fi
.SH CONFIGURATION
Optionally add the following lines to ~/.bashrc:
.nf
.sp
export HH_CONFIG=hicolor         # get more colors
shopt -s histappend              # append new history items to .bash_history
export HISTCONTROL=ignorespace   # leading space hides commands from history
export HISTFILESIZE=10000        # increase history file size (default is 500)
export HISTSIZE=${HISTFILESIZE}  # increase history size (default is 500)
export PROMPT_COMMAND="history \-a; history \-n; ${PROMPT_COMMAND}"
bind '"\eC\-r": "\eC\-a hh \eC-j"'    # bind hh to Ctrl-r
.sp
.fi
The prompt command ensures synchronization of the history between BASH memory 
and history file.
.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)
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/hstr

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/hstr

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master