mirror of
https://github.com/dvorka/hstr.git
synced 2024-12-28 18:50:54 +08:00
Fixed #88 by completing MDs and man page with non-documented configuration options.
This commit is contained in:
parent
48df2d5082
commit
3b17f01bd1
2 changed files with 62 additions and 10 deletions
|
@ -1,13 +1,26 @@
|
|||
CONFIGURATION EXPLANATION
|
||||
=========================
|
||||
`hh` works best with the optional configuration described in this section.
|
||||
You can configure `hh` just by running:
|
||||
CONFIGURATION
|
||||
=============
|
||||
Get most of `hh` by configuring it with:
|
||||
```bash
|
||||
hh --show-configuration >> ~/.bashrc
|
||||
```
|
||||
You may want to check:
|
||||
```bash
|
||||
hh --show-configuration
|
||||
```
|
||||
to determine what will be appended to your BASH profile.
|
||||
|
||||
CONFIGURATION OPTIONS
|
||||
---------------------
|
||||
This document describes `hh` related configuration in detail -
|
||||
[binding hh to keyword shortcuts](#binding-hh-to-keyboard-shortcut),
|
||||
[colors](#colors),
|
||||
[default history view](#history-view)
|
||||
[BASH history settings](#bash-history-settings)
|
||||
and [examples](#examples).
|
||||
|
||||
|
||||
|
||||
BINDING HH TO KEYBOARD SHORTCUT
|
||||
-------------------------------
|
||||
Bind `hh` to a BASH key e.g. to `Ctrl-r`:
|
||||
```bash
|
||||
bind '"\C-r": "\C-ahh \C-j"'
|
||||
|
@ -31,11 +44,20 @@ type `Ctrl-v` and then press the key. Check your current bindings using:
|
|||
bind -S
|
||||
```
|
||||
|
||||
COLORS
|
||||
------
|
||||
Get `hh` in more colors:
|
||||
```bash
|
||||
export HH_CONFIG=hicolor
|
||||
```
|
||||
show normal history by default (instead of metrics-based view):
|
||||
or in black and white mode:
|
||||
```bash
|
||||
export HH_CONFIG=monochromatic
|
||||
```
|
||||
|
||||
HISTORY VIEW
|
||||
------------
|
||||
Show normal history by default (instead of metrics-based view):
|
||||
```bash
|
||||
export HH_CONFIG=rawhistory
|
||||
```
|
||||
|
@ -43,10 +65,16 @@ show favorites by default (instead of metrics-based view):
|
|||
```bash
|
||||
export HH_CONFIG=favorites
|
||||
```
|
||||
|
||||
FILTERING
|
||||
---------
|
||||
make search case sensitive (insensitive by default):
|
||||
```bash
|
||||
export HH_CONFIG=casesensitive
|
||||
```
|
||||
|
||||
VERBOSE
|
||||
-------
|
||||
show warnings:
|
||||
```bash
|
||||
export HH_CONFIG=warning
|
||||
|
@ -55,10 +83,28 @@ show debug messages:
|
|||
```bash
|
||||
export HH_CONFIG=debug
|
||||
```
|
||||
more colors and case sensitive search:
|
||||
|
||||
EXAMPLES
|
||||
--------
|
||||
`hh` configuration examples.
|
||||
|
||||
More colors with case sensitive search of history:
|
||||
```bash
|
||||
export HH_CONFIG=hicolor,casesensitive
|
||||
```
|
||||
Favorite commands view in black and white:
|
||||
```bash
|
||||
export HH_CONFIG=favorites,monochromatic
|
||||
```
|
||||
Keywords based search in colors with debug mode verbosity:
|
||||
```bash
|
||||
export HH_CONFIG=keywords,hicolor,debug
|
||||
```
|
||||
|
||||
|
||||
BASH HISTORY SETTINGS
|
||||
---------------------
|
||||
Use the following BASH settings to get most out of `hh`.
|
||||
|
||||
Increase the size of history:
|
||||
```bash
|
||||
|
|
10
man/hh.1
10
man/hh.1
|
@ -73,7 +73,7 @@ Write changes to shell history and exit.
|
|||
\fBCtrl\-g\fR
|
||||
Exit with empty prompt.
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
\fBhh\fR defines the following environment variable:
|
||||
\fBhh\fR defines the following environment variables:
|
||||
.TP
|
||||
\fBHH_CONFIG\fR
|
||||
Configuration options:
|
||||
|
@ -81,12 +81,18 @@ Configuration options:
|
|||
\fIhicolor\fR
|
||||
Get more colors with this option (default is monochromatic).
|
||||
|
||||
\fImonochromatic\fR
|
||||
Ensure black and white view with this option.
|
||||
|
||||
\fIregexp\fR
|
||||
Filter command history using regular expressions (substring match is default)
|
||||
|
||||
\fIsubstring\fR
|
||||
Filter command history using substring.
|
||||
|
||||
\fIkeywords\fR
|
||||
Filter command history using keywords - item matches if contains all keywords in pattern in any order.
|
||||
|
||||
\fIcasesensitive\fR
|
||||
Make history filtering case sensitive (it's case insensitive by default).
|
||||
|
||||
|
@ -103,7 +109,7 @@ Configuration options:
|
|||
Show debug information.
|
||||
|
||||
Example:
|
||||
\fBexport HH_CONFIG=hicolor,regexp\fR
|
||||
\fBexport HH_CONFIG=hicolor,regexp,rawhistory\fR
|
||||
|
||||
.TP
|
||||
\fBHH_PROMPT\fR
|
||||
|
|
Loading…
Reference in a new issue