1
This document is an unfinished draft.
36
`hh` is typically started by pressing `Ctrl-r` after
37
you configure it for this shorcut for your shell. However,
38
you can run it as a normal program just by typing:
43
It opens a page with a history view (ranking view is default).
44
Alternatively you can run `hh` in non-interactive mode -
45
commands are just listed on standard output based on history
51
Filtering pattern can be optionally specified as well:
56
Prints history items containing `git` to standard output and
61
When `hh` starts in interative mode, a view of commands
62
is shown. This list of commands can be filtered just by typing
66
### Choosing a command
67
When you filtered the view of history items enough, you can
68
move around it with `UP` and `DOWN` arrow keys. Selected history
69
items is highlighted. Once you are done with your choice:
71
* press `ENTER` to choose the command and execute it
72
* or press `TAB` or `RIGHT` arrow key to choose the command and edit it on command line after exiting `hh`
73
* or press `LEFT` arrow key to choose the command and open it in editor (Bash `fc` i.e. fix command)
79
`hh` allows you to store and manage your favorite
82
A new favorite command can be added from
83
ranking or raw history view by pressing `Ctrl-f`.
85
You can check your favorite commands by choosing
86
favorite view - rotate views using `Ctrl-/` or start
87
`hh` by adding `favorites` to `HH_CONFIG` environment
88
property. A favorite command can be choosen just
89
by pressing `ENTER` when on command in favorite view.
90
Last chosen favorite commands appears as the first
91
one (at the top of the page) in the favorite view.
92
You can delete a favorite command with `DEL` key.
95
* Favorite commands are stored in `~/.hh_favorites`
96
* Suffix your favorite commands with comments
97
describing their purpose. For example
98
`printf "\e[?2004l" # fix terminal copy/paste`
99
Such comment can be used for normal commands
100
as well and may serve as a way how to **tag**
106
`hh` allows you to specify a set of commands to be
107
skipped from all the views. Blacklist typically contains
108
frequently used commands whose completion from history
109
has a little or no value. The default blacklist looks
122
* Blacklist of commands is stored in `~/.hh_blacklist`
123
If the file doesn't exist, you may create it and complete
124
it with your own blacklist.
125
* You can skip any command from history just by
126
prefixing it with `SPACE`. For example:
127
` echo "Skip this from history"` It's a Bash
128
option that is configured using
129
`HISTCONTROL=ignorespace` environment variable.
134
Get more colors when running `hh`:
136
export HH_CONFIG=hicolor
139
Start `hh` in configured view and filter out history items
145
Print history items containing 'git' to standard output and exit:
147
hh --non-interactive git
150
Append default `hh` configuration to your Bash profile:
152
hh --show-configuration >> ~/.bashrc