File CONFIGURATION.md changed (mode: 100644) (index 189c720..76d6791) |
... |
... |
Bind `hh` to <kbd>Ctrl-r</kbd> only if it is interactive shell: |
56 |
56 |
```bash |
```bash |
57 |
57 |
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hh -- \C-j"'; fi |
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hh -- \C-j"'; fi |
58 |
58 |
``` |
``` |
|
59 |
|
You can bind also other `hh` commands like `-kill-last-command`: |
|
60 |
|
```bash |
|
61 |
|
if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hh -k \C-j"'; fi |
|
62 |
|
``` |
|
63 |
|
|
59 |
64 |
|
|
60 |
65 |
## BASH VI KEYMAP |
## BASH VI KEYMAP |
61 |
66 |
Bind `hh` to a Bash key e.g. to <kbd>Ctrl-r</kbd>: |
Bind `hh` to a Bash key e.g. to <kbd>Ctrl-r</kbd>: |
|
... |
... |
export HH_CONFIG=noconfirm |
131 |
136 |
|
|
132 |
137 |
VERBOSITY |
VERBOSITY |
133 |
138 |
--------- |
--------- |
|
139 |
|
Show a message when deleting the last command from history: |
|
140 |
|
```bash |
|
141 |
|
export HH_CONFIG=verbose-kill |
|
142 |
|
``` |
134 |
143 |
Show warnings: |
Show warnings: |
135 |
144 |
```bash |
```bash |
136 |
145 |
export HH_CONFIG=warning |
export HH_CONFIG=warning |
File DOCUMENTATION.md changed (mode: 100644) (index be18cc6..0198b92) |
... |
... |
Table of contents: |
28 |
28 |
* Choosing a command |
* Choosing a command |
29 |
29 |
* Favorite commands |
* Favorite commands |
30 |
30 |
* Blacklist |
* Blacklist |
|
31 |
|
* Delete last command |
31 |
32 |
* Examples |
* Examples |
32 |
33 |
|
|
33 |
34 |
|
|
|
... |
... |
Tips: |
128 |
129 |
option that is configured using |
option that is configured using |
129 |
130 |
`HISTCONTROL=ignorespace` environment variable. |
`HISTCONTROL=ignorespace` environment variable. |
130 |
131 |
|
|
|
132 |
|
Blacklist |
|
133 |
|
--------- |
|
134 |
|
Using `hh` you can easily delete the last command from history |
|
135 |
|
e.g. when you make a typo or write something sensitive: |
|
136 |
|
``` |
|
137 |
|
hh --kill-last-command |
|
138 |
|
``` |
|
139 |
|
See configuration section for how to bind this functionality to |
|
140 |
|
a key - bound to <kbd>Ctrl+x k</kbd> by default. |
|
141 |
|
|
131 |
142 |
|
|
132 |
143 |
Examples |
Examples |
133 |
144 |
-------- |
-------- |
File src/hstr.c changed (mode: 100644) (index bc77a60..0e779b0) |
... |
... |
static const char *INSTALL_BASH_STRING= |
214 |
214 |
"\nif [[ $- =~ .*i.* ]]; then bind -x '\"\\C-r\": \"hstr_cygwin\"'; fi" |
"\nif [[ $- =~ .*i.* ]]; then bind -x '\"\\C-r\": \"hstr_cygwin\"'; fi" |
215 |
215 |
#else |
#else |
216 |
216 |
"\nif [[ $- =~ .*i.* ]]; then bind '\"\\C-r\": \"\\C-a hh -- \\C-j\"'; fi" |
"\nif [[ $- =~ .*i.* ]]; then bind '\"\\C-r\": \"\\C-a hh -- \\C-j\"'; fi" |
|
217 |
|
"\n# if this is interactive shell, then bind 'kill last command' to Ctrl-x k" |
|
218 |
|
"\nif [[ $- =~ .*i.* ]]; then bind '\"\\C-xk\": \"\\C-a hh -k \\C-j\"'; fi" |
217 |
219 |
#endif |
#endif |
218 |
220 |
"\n\n"; |
"\n\n"; |
219 |
221 |
|
|