hstr/README.md

96 lines
2 KiB
Markdown
Raw Normal View History

2013-12-03 06:47:51 +08:00
hstr
====
2014-01-24 15:31:55 +08:00
BASH History Suggest Box - [http://www.youtube.com/watch?v=sPF29NyXe2U](http://www.youtube.com/watch?v=sPF29NyXe2U)
2014-01-20 04:54:14 +08:00
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:28:13 +08:00
[![Shell History Suggest Box](http://mindforger.com/projects/images/hh-1.jpg "Shell History Suggest Box")](http://mindforger.com/projects/images/hh-1.jpg)
2013-12-16 15:15:11 +08:00
UBUNTU INSTALLATION
-------------------
* install `hh` on Ubuntu (12.10/13.04/13.10):
2013-12-26 08:17:46 +08:00
`sudo add-apt-repository ppa:ultradvorka/ppa`
`sudo apt-get update`
`sudo apt-get install hh`
* Configure `hh`:
`hh --show-configuration >> ~/.bashrc`
2014-01-10 08:21:21 +08:00
2014-01-10 08:30:53 +08:00
DOWNLOAD
--------
https://github.com/dvorka/hstr/releases
2014-01-10 08:21:21 +08:00
SOURCE CODE INSTALLATION
------------------------
* download distribution (project Releases section), expand the archive and install `hh`:
`./configure && make && make install`
* Configure `hh`:
`hh --show-configuration >> ~/.bashrc`
2014-01-10 08:21:21 +08:00
2013-12-26 08:17:46 +08:00
MAC OS
------
2014-01-17 11:46:12 +08:00
* install MacPorts:
http://www.macports.org
* configure using:
`env CFLAGS="-I/opt/local/include -I/usr/include" LDFLAGS="-L/opt/local/lib -L/usr/lib" ./configure`
* finish the installation
`make && make install`
* Configure `hh`:
`hh --show-configuration >> ~/.bashrc`
CONFIGURATION EXPLANATION
-------------------------
* appending of the in memory history (instead of overwriting it)
to `.bash_history`:
`shopt -s histappend`
* flushing and realoading of `.bash_history` in order to ensure that
it is in sync with memory:
2013-12-15 22:49:07 +08:00
`export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"`
* binding of `hh` to a BASH key (e.g. to `Ctrl-R`):
2013-12-03 06:58:34 +08:00
2014-01-17 11:46:12 +08:00
`bind '"\C-r": "\C-ahh \C-j"'`
2013-12-03 06:58:34 +08:00
`Ctrl-F12` would be:
2013-12-03 06:58:34 +08:00
2014-01-17 11:46:12 +08:00
`bind '"\e[24;5~":"\C-ahh \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. 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