hstr/README.md

69 lines
1.5 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-01 14:14:19 +08:00
[![Shell History Suggest Box](http://mindforger.com/projects/images/hh.png "Shell History Suggest Box")](https://github.com/dvorka/hstr)
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
2013-12-26 08:17:46 +08:00
SOURCE CODE INSTALLATION
2014-01-01 17:54:41 +08:00
------------------------
2013-12-26 08:17:46 +08:00
* download distribution, expand it and install `hh`:
2013-12-26 03:20:36 +08:00
`./configure && make && make install`
2013-12-26 08:17:46 +08:00
* Configure `hh` as described below.
2013-12-26 03:20:36 +08:00
2013-12-26 08:17:46 +08:00
2014-01-01 17:54:41 +08:00
UBUNTU 13.04 INSTALLATION
-------------------------
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`
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