File CONFIGURATION.md changed (mode: 100644) (index 3acb009..99563f6) |
1 |
|
CONFIGURATION EXPLANATION |
|
2 |
|
========================= |
|
3 |
|
`hh` works best with the optional configuration described in this section. |
|
4 |
|
You can configure `hh` just by running: |
|
|
1 |
|
CONFIGURATION |
|
2 |
|
============= |
|
3 |
|
Get most of `hh` by configuring it with: |
5 |
4 |
```bash |
```bash |
6 |
5 |
hh --show-configuration >> ~/.bashrc |
hh --show-configuration >> ~/.bashrc |
7 |
6 |
``` |
``` |
|
7 |
|
You may want to check: |
|
8 |
|
```bash |
|
9 |
|
hh --show-configuration |
|
10 |
|
``` |
|
11 |
|
to determine what will be appended to your BASH profile. |
8 |
12 |
|
|
9 |
|
CONFIGURATION OPTIONS |
|
10 |
|
--------------------- |
|
|
13 |
|
This document describes `hh` related configuration in detail - |
|
14 |
|
[binding hh to keyword shortcuts](#binding-hh-to-keyboard-shortcut), |
|
15 |
|
[colors](#colors), |
|
16 |
|
[default history view](#history-view) |
|
17 |
|
[BASH history settings](#bash-history-settings) |
|
18 |
|
and [examples](#examples). |
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
BINDING HH TO KEYBOARD SHORTCUT |
|
23 |
|
------------------------------- |
11 |
24 |
Bind `hh` to a BASH key e.g. to `Ctrl-r`: |
Bind `hh` to a BASH key e.g. to `Ctrl-r`: |
12 |
25 |
```bash |
```bash |
13 |
26 |
bind '"\C-r": "\C-ahh \C-j"' |
bind '"\C-r": "\C-ahh \C-j"' |
|
... |
... |
type `Ctrl-v` and then press the key. Check your current bindings using: |
31 |
44 |
bind -S |
bind -S |
32 |
45 |
``` |
``` |
33 |
46 |
|
|
|
47 |
|
COLORS |
|
48 |
|
------ |
34 |
49 |
Get `hh` in more colors: |
Get `hh` in more colors: |
35 |
50 |
```bash |
```bash |
36 |
51 |
export HH_CONFIG=hicolor |
export HH_CONFIG=hicolor |
37 |
52 |
``` |
``` |
38 |
|
show normal history by default (instead of metrics-based view): |
|
|
53 |
|
or in black and white mode: |
|
54 |
|
```bash |
|
55 |
|
export HH_CONFIG=monochromatic |
|
56 |
|
``` |
|
57 |
|
|
|
58 |
|
HISTORY VIEW |
|
59 |
|
------------ |
|
60 |
|
Show normal history by default (instead of metrics-based view): |
39 |
61 |
```bash |
```bash |
40 |
62 |
export HH_CONFIG=rawhistory |
export HH_CONFIG=rawhistory |
41 |
63 |
``` |
``` |
|
... |
... |
show favorites by default (instead of metrics-based view): |
43 |
65 |
```bash |
```bash |
44 |
66 |
export HH_CONFIG=favorites |
export HH_CONFIG=favorites |
45 |
67 |
``` |
``` |
|
68 |
|
|
|
69 |
|
FILTERING |
|
70 |
|
--------- |
46 |
71 |
make search case sensitive (insensitive by default): |
make search case sensitive (insensitive by default): |
47 |
72 |
```bash |
```bash |
48 |
73 |
export HH_CONFIG=casesensitive |
export HH_CONFIG=casesensitive |
49 |
74 |
``` |
``` |
|
75 |
|
|
|
76 |
|
VERBOSE |
|
77 |
|
------- |
50 |
78 |
show warnings: |
show warnings: |
51 |
79 |
```bash |
```bash |
52 |
80 |
export HH_CONFIG=warning |
export HH_CONFIG=warning |
|
... |
... |
show debug messages: |
55 |
83 |
```bash |
```bash |
56 |
84 |
export HH_CONFIG=debug |
export HH_CONFIG=debug |
57 |
85 |
``` |
``` |
58 |
|
more colors and case sensitive search: |
|
|
86 |
|
|
|
87 |
|
EXAMPLES |
|
88 |
|
-------- |
|
89 |
|
`hh` configuration examples. |
|
90 |
|
|
|
91 |
|
More colors with case sensitive search of history: |
59 |
92 |
```bash |
```bash |
60 |
93 |
export HH_CONFIG=hicolor,casesensitive |
export HH_CONFIG=hicolor,casesensitive |
61 |
94 |
``` |
``` |
|
95 |
|
Favorite commands view in black and white: |
|
96 |
|
```bash |
|
97 |
|
export HH_CONFIG=favorites,monochromatic |
|
98 |
|
``` |
|
99 |
|
Keywords based search in colors with debug mode verbosity: |
|
100 |
|
```bash |
|
101 |
|
export HH_CONFIG=keywords,hicolor,debug |
|
102 |
|
``` |
|
103 |
|
|
|
104 |
|
|
|
105 |
|
BASH HISTORY SETTINGS |
|
106 |
|
--------------------- |
|
107 |
|
Use the following BASH settings to get most out of `hh`. |
62 |
108 |
|
|
63 |
109 |
Increase the size of history: |
Increase the size of history: |
64 |
110 |
```bash |
```bash |
File man/hh.1 changed (mode: 100644) (index 94dd971..4c49edc) |
... |
... |
Write changes to shell history and exit. |
73 |
73 |
\fBCtrl\-g\fR |
\fBCtrl\-g\fR |
74 |
74 |
Exit with empty prompt. |
Exit with empty prompt. |
75 |
75 |
.SH ENVIRONMENT VARIABLES |
.SH ENVIRONMENT VARIABLES |
76 |
|
\fBhh\fR defines the following environment variable: |
|
|
76 |
|
\fBhh\fR defines the following environment variables: |
77 |
77 |
.TP |
.TP |
78 |
78 |
\fBHH_CONFIG\fR |
\fBHH_CONFIG\fR |
79 |
79 |
Configuration options: |
Configuration options: |
|
... |
... |
Configuration options: |
81 |
81 |
\fIhicolor\fR |
\fIhicolor\fR |
82 |
82 |
Get more colors with this option (default is monochromatic). |
Get more colors with this option (default is monochromatic). |
83 |
83 |
|
|
|
84 |
|
\fImonochromatic\fR |
|
85 |
|
Ensure black and white view with this option. |
|
86 |
|
|
84 |
87 |
\fIregexp\fR |
\fIregexp\fR |
85 |
88 |
Filter command history using regular expressions (substring match is default) |
Filter command history using regular expressions (substring match is default) |
86 |
89 |
|
|
87 |
90 |
\fIsubstring\fR |
\fIsubstring\fR |
88 |
91 |
Filter command history using substring. |
Filter command history using substring. |
89 |
92 |
|
|
|
93 |
|
\fIkeywords\fR |
|
94 |
|
Filter command history using keywords - item matches if contains all keywords in pattern in any order. |
|
95 |
|
|
90 |
96 |
\fIcasesensitive\fR |
\fIcasesensitive\fR |
91 |
97 |
Make history filtering case sensitive (it's case insensitive by default). |
Make history filtering case sensitive (it's case insensitive by default). |
92 |
98 |
|
|
|
... |
... |
Configuration options: |
103 |
109 |
Show debug information. |
Show debug information. |
104 |
110 |
|
|
105 |
111 |
Example: |
Example: |
106 |
|
\fBexport HH_CONFIG=hicolor,regexp\fR |
|
|
112 |
|
\fBexport HH_CONFIG=hicolor,regexp,rawhistory\fR |
107 |
113 |
|
|
108 |
114 |
.TP |
.TP |
109 |
115 |
\fBHH_PROMPT\fR |
\fBHH_PROMPT\fR |