hstr/README.md

71 lines
1.6 KiB
Markdown
Raw Normal View History

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.
2014-01-10 08:21:21 +08:00
[![Shell History Suggest Box](http://mindforger.com/projects/images/hh.png "Shell History Suggest Box")](http://mindforger.com/projects/images/hh.png)
2013-12-16 15:15:11 +08:00
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
2014-01-07 15:41:22 +08:00
UBUNTU 12.10/13.04/13.10 INSTALLATION
2014-01-01 17:54:41 +08:00
-------------------------
2013-12-26 08:17:46 +08:00
* install `hh` on Ubuntu:
`sudo add-apt-repository ppa:ultradvorka/ppa`
`sudo apt-get update`
`sudo apt-get install hh`
2014-01-10 08:21:21 +08:00
* Configure `hh` as described below.
SOURCE CODE INSTALLATION
------------------------
* download distribution (project Releases section), expand the archive and install `hh`:
`./configure && make && make install`
* Configure `hh` as described below.
2013-12-26 08:17:46 +08:00
CONFIGURATION
2013-12-03 06:55:33 +08:00
------------
* add
`shopt -s histappend`
2013-12-15 22:49: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 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,
2013-12-26 03:20:36 +08:00
type CTRL-v and then press the key. 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