lee-pai-long
4/29/2016 - 4:04 PM

install-hstr_linux-mint-17.2.md

[LINUX MINT 17.2] Install hstr

HSTR is a shell history suggest box that aim to replace and/or improve the builtin linux reverse-i-search shell feature.

Intallation

$ [sudo] add-apt-repository ppa:ultradvorka/ppa && \
> [sudo] apt-get update && \
> [sudo] apt-get install hh

Configuration:

Show possible configuration:

$ hh --show-configuration

I already have some of those lines (or equivalents) so I just added specific hh lines, then looking to hstr configuration documentation I added a few more options:

export HH_CONFIG=hicolor,favorites,casesensitive,blacklist
  • hicolor: Get hh in more colors
  • favorites: Show favorite commands by default (favorites file should be store in ~/.hh_favorite)
  • casesensitive: Make search case sensitive
  • blacklist: Skip commands when processing history (blacklist file should be store in ~/.hh_blacklist)
Change hh prompt string
export HH_PROMPT="$USER @ $HOSTNAME : $PWD $ "
Keyboard shortcut
if [[ $- =~ .*i.* ]]; then bind '"\C-h": "\C-a hh \C-j"'; fi

for interactive shell then bind hh to Ctrl-h instead of Ctrl-r, this allow us to have the two features available

Sources: