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 a6d96409f8e1fb71cdc7fc5a3557967a49c7fc62

More Ctrl-r consistency: Ctrl-r to navigate history, DEL to delete history entry
Author: Martin Dvorak
Author date (UTC): 2014-01-19 07:57
Committer name: Martin Dvorak
Committer date (UTC): 2014-01-19 07:57
Parent(s): 80c2cba194a080bef6a482c21b918da86eedb507
Signing key:
Tree: f856d25637ff3d043723eb2e0e7c3e558fdf04a7
File Lines added Lines deleted
configure.ac 2 2
debian/changelog 1 1
debian/control 1 1
dist/env.sh 2 2
man/hh.1 2 2
src/hstr.c 3 2
File configure.ac changed (mode: 100644) (index 9a28e3c..0d3261f)
4 4
5 5 AC_PREREQ([2.69]) AC_PREREQ([2.69])
6 6
7 AC_INIT(hh, 0.73, martin.dvorak@mindforger.com)
8 AM_INIT_AUTOMAKE(hh, 0.73)
7 AC_INIT(hh, 0.90, martin.dvorak@mindforger.com)
8 AM_INIT_AUTOMAKE(hh, 0.90)
9 9 AC_OUTPUT(Makefile src/Makefile man/Makefile) AC_OUTPUT(Makefile src/Makefile man/Makefile)
10 10
11 11 # Checks for src dir existence. # Checks for src dir existence.
File debian/changelog changed (mode: 100644) (index b62653b..f57888e)
1 1 hh (0.80-0ubuntu1) raring; urgency=low hh (0.80-0ubuntu1) raring; urgency=low
2 2
3 * Highlighted selection row and metrics/history ordering.
3 * Fixed keyboard loop; Ctrl-r consistent shortcuts; propagation of the text from the prompt to HH.
4 4
5 5 -- Martin Dvorak (Dvorka) <martin.dvorak@mindforger.com> Wed, 25 Dec 2013 17:21:31 +0100 -- Martin Dvorak (Dvorka) <martin.dvorak@mindforger.com> Wed, 25 Dec 2013 17:21:31 +0100
File debian/control changed (mode: 100644) (index 1ee96df..e88f57d)
... ... Architecture: any
13 13 Depends: ${shlibs:Depends}, ${misc:Depends} Depends: ${shlibs:Depends}, ${misc:Depends}
14 14 Description: Suggest box like shell history completion Description: Suggest box like shell history completion
15 15 A command line utility that brings improved shell command completion A command line utility that brings improved shell command completion
16 from the history. It aims to make completion easier and faster than Ctrl-R.
16 from the history. It aims to make completion easier and faster than Ctrl-r.
17 17 Tag: implemented-in::c++, interface::commandline, role::program Tag: implemented-in::c++, interface::commandline, role::program
File dist/env.sh changed (mode: 100755) (index d26bcf3..9eb4bab)
1 1 #!/bin/bash #!/bin/bash
2 2
3 export HHVERSION="0.82"
3 export HHVERSION="0.92"
4 4 export HHFULLVERSION=${HHVERSION}-0ubuntu1 export HHFULLVERSION=${HHVERSION}-0ubuntu1
5 5 export HH=hh_${HHVERSION} export HH=hh_${HHVERSION}
6 6 export HHRELEASE=hh_${HHFULLVERSION} export HHRELEASE=hh_${HHFULLVERSION}
 
... ... export HHBUILD=hstr-${NOW}
12 12 #export UBUNTUVERSION=raring #export UBUNTUVERSION=raring
13 13 export UBUNTUVERSION=saucy export UBUNTUVERSION=saucy
14 14
15 export HHBZRMSG="Highlighted selection row and metrics/history ordering."
15 export HHBZRMSG="Fixed keyboard loop; Ctrl-r consistent shortcuts; propagation of the text from the prompt to HH."
16 16
17 17 # - edit config.am ... set new version # - edit config.am ... set new version
18 18 # - user email must be as in gpg i.e. (Dvorka) must present # - user email must be as in gpg i.e. (Dvorka) must present
File man/hh.1 changed (mode: 100644) (index 419a448..423ade5)
... ... Toggle case sensitive search.
26 26 \fBCtrl\-h\fR \fBCtrl\-h\fR
27 27 Toggle history as provided by shell vs. ranked history ordered by the number of occurences, length and timestamp. Toggle history as provided by shell vs. ranked history ordered by the number of occurences, length and timestamp.
28 28 .TP .TP
29 \fBUP\fR arrow, \fBDOWN\fR arrow
29 \fBUP\fR arrow, \fBDOWN\fR arrow, \fBCtrl\-r\fR
30 30 Navigate in the history list. Navigate in the history list.
31 31 .TP .TP
32 32 \fBTAB\fR \fBTAB\fR
 
... ... Choose currently selected item for completion and let user to edit it on the com
35 35 \fBENTER\fR \fBENTER\fR
36 36 Choose currently selected item for completion and execute it. Choose currently selected item for completion and execute it.
37 37 .TP .TP
38 \fBCtrl\-r\fR
38 \fBDEL\fR
39 39 Remove currently selected item from the shell history. Remove currently selected item from the shell history.
40 40 .TP .TP
41 41 \fBCtrl\-x\fR \fBCtrl\-x\fR
File src/hstr.c changed (mode: 100644) (index a61d072..b9250dc)
... ... static const char *BUILD_STRING=
76 76 "HH build: "__DATE__" " __TIME__""; "HH build: "__DATE__" " __TIME__"";
77 77
78 78 static const char *LABEL_HELP= static const char *LABEL_HELP=
79 "Type to filter, UP/DOWN to move, C-r to remove, ENTER to select, C-x to exit";
79 "Type to filter, UP/DOWN to move, DEL to remove, TAB to select, C-g to cancel";
80 80
81 81 static char **selection=NULL; static char **selection=NULL;
82 82 static unsigned selectionSize=0; static unsigned selectionSize=0;
 
... ... char *selection_loop(HistoryItems *history)
357 357 } }
358 358
359 359 switch (c) { switch (c) {
360 case K_CTRL_R:
360 case KEY_DC:
361 361 if(selectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) { if(selectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) {
362 362 delete=selection[selectionCursorPosition]; delete=selection[selectionCursorPosition];
363 363 msg=malloc(strlen(delete)+1); msg=malloc(strlen(delete)+1);
 
... ... char *selection_loop(HistoryItems *history)
421 421 highlight_selection(selectionCursorPosition, previousSelectionCursorPosition, prefix); highlight_selection(selectionCursorPosition, previousSelectionCursorPosition, prefix);
422 422 move(y, basex+strlen(prefix)); move(y, basex+strlen(prefix));
423 423 break; break;
424 case K_CTRL_R:
424 425 case KEY_DOWN: case KEY_DOWN:
425 426 if(selectionCursorPosition==SELECTION_CURSOR_IN_PROMPT) { if(selectionCursorPosition==SELECTION_CURSOR_IN_PROMPT) {
426 427 selectionCursorPosition=previousSelectionCursorPosition=0; selectionCursorPosition=previousSelectionCursorPosition=0;
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