xaizek / hstr (License: Apachev2) (since 2018-12-07)
Bash and Zsh shell history suggest box - easily view, navigate, search and manage your command history.
Commit 00c867dc78e6537d685867ac530961beb05be437

Adding binding of -k to C-x k #251.
Author: Martin Dvorak
Author date (UTC): 2018-02-21 08:06
Committer name: Martin Dvorak
Committer date (UTC): 2018-02-21 08:06
Parent(s): 5cd7e1548b826b5ea43d67e78731d1d245a7dab8
Signing key:
Tree: 6a6d1f611130fa913fd519ac5ceb50fa7a67cd3a
File Lines added Lines deleted
CONFIGURATION.md 9 0
DOCUMENTATION.md 11 0
src/hstr.c 2 0
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
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/hstr

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/hstr

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master