2013-12-03 06:47:51 +08:00
|
|
|
hstr
|
|
|
|
====
|
|
|
|
|
2013-12-15 19:32:19 +08:00
|
|
|
BASH History Suggest Box
|
2013-12-03 06:55:33 +08:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
A command line utility that brings improved BASH command completion
|
2013-12-15 19:32:19 +08:00
|
|
|
from the history. It aims to make completion easier and faster
|
2013-12-03 06:55:33 +08:00
|
|
|
than Ctrl-R.
|
|
|
|
|
|
|
|
|
2013-12-16 15:15:11 +08:00
|
|
|
[![Shell History Suggest Box](http://www.mindcognition.com/hstr/hstr.png "Shell History Suggest Box")](https://github.com/dvorka/hstr)
|
|
|
|
|
|
|
|
|
2013-12-03 06:55:33 +08:00
|
|
|
DOWNLOAD
|
|
|
|
--------
|
2013-12-03 15:54:19 +08:00
|
|
|
https://github.com/dvorka/hstr/releases
|
2013-12-03 06:55:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
INSTALLATION
|
|
|
|
------------
|
2013-12-18 16:31:44 +08:00
|
|
|
* add `hh` to `$PATH`
|
2013-12-15 21:13:07 +08:00
|
|
|
* add
|
|
|
|
|
|
|
|
`shopt -s histappend`
|
2013-12-15 22:49:07 +08:00
|
|
|
|
2013-12-15 21:13:07 +08:00
|
|
|
`export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"`
|
|
|
|
|
|
|
|
at the end of `.bashrc` in order to ensure that BASH history of commands
|
|
|
|
will be kept in sync with filesystem.
|
|
|
|
* bind `hh` to a BASH key by adding a line to `.bashrc`, e.g. Ctrl-R:
|
2013-12-03 06:58:34 +08:00
|
|
|
|
2013-12-04 05:42:51 +08:00
|
|
|
`bind '"\C-r": "\C-k\C-uhh\C-j"'`
|
2013-12-03 06:58:34 +08:00
|
|
|
|
2013-12-04 05:42:51 +08:00
|
|
|
or F12:
|
2013-12-03 06:58:34 +08:00
|
|
|
|
2013-12-04 05:42:51 +08:00
|
|
|
`bind '"\e[24~":"\C-k\C-uhh\C-j"'`
|
2013-12-03 06:58:34 +08:00
|
|
|
|
2013-12-04 05:42:51 +08:00
|
|
|
or Ctrl-F12:
|
2013-12-03 06:58:34 +08:00
|
|
|
|
2013-12-04 05:42:51 +08:00
|
|
|
`bind '"\e[24;5~":"\C-k\C-uhh\C-j"'`
|
2013-12-03 06:58:34 +08:00
|
|
|
|
2013-12-04 05:42:51 +08:00
|
|
|
To determine the character sequence emitted by a pressed key in terminal,
|
|
|
|
type CTRL-v and then press the key. For example, F12 gives `^[[24~`.
|
2013-12-15 21:13:07 +08:00
|
|
|
Replace the `^[` with `\e`. To clear the line first, add `\C-k \C-u` in
|
|
|
|
front of the actual command. Check your current bindings using:
|
2013-12-03 06:58:34 +08:00
|
|
|
|
2013-12-03 14:53:09 +08:00
|
|
|
`bind -S`
|
2013-12-03 06:55:33 +08:00
|
|
|
|
|
|
|
BUGS
|
|
|
|
----
|
2013-12-03 15:54:19 +08:00
|
|
|
https://github.com/dvorka/hstr/issues
|
2013-12-03 06:55:33 +08:00
|
|
|
|