hstr/README.md

50 lines
1.1 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.
DOWNLOAD
--------
2013-12-03 15:54:19 +08:00
https://github.com/dvorka/hstr/releases
2013-12-03 06:55:33 +08:00
INSTALLATION
------------
* add
`shopt -s histappend`
`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~`.
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