![]() |
![]()
| ![]() |
![]()
NAMEhstr - easily view, navigate, sort and use your command history with shell history suggest box. SYNOPSIShstr [option] [arg1] [arg2]... DESCRIPTIONhstr 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. Favorite and frequently used commands can be bookmarked. In addition hstr allows removal of commands from history - for instance with a typo or with a sensitive content. OPTIONS
KEYS
ENVIRONMENT VARIABLEShstr defines the following environment variables:
FILES
BASH CONFIGURATIONOptionally add the following lines to ~/.bashrc: alias hh=hstr # make hh alias of hstr export HSTR_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) # ensure synchronization between bash memory and history file export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" # if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc) if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi ZSH CONFIGURATIONOptionally add the following lines to ~/.zshrc: export HSTR_CONFIG=hicolor # get more colors setopt histignorespace # skip cmds w/ leading space from history bindkey -s "\C-r" "\C-a hstr -- \C-j" # bind hstr to Ctrl-r (for Vi mode check doc) EXAMPLES
AUTHORWritten by Martin Dvorak <martin.dvorak@mindforger.com> BUGSReport bugs to https://github.com/dvorka/hstr/issues SEE ALSOhistory(1), bash(1), zsh(1)
|