Search highlight is cleared after a timeout, which is one second by default.
Timeout period can be changed by setting an environment variable; example below
for setting one minute timeout.
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT=60
Fixes#131
See 810c2dcede
I'm not sure if it should be used even in our dummy _zsh_highlight or
not and, to be honest, I couldn't figure out why is this dummy
_zsh_highlight needed at all, so I left it unchanged.
zsh-syntax-highlighting started using zle-line-pre-redraw hook instead
of the legacy "bind all widgets" if 1) zsh has the memo= feature (added
in version 5.9) and 2) add-zle-hook-widget is available.
Now when zsh-history-substring-search is loaded before
zsh-syntax-highlighting, it causes error:
_zsh_highlight_widget_zle-line-pre-redraw: job table full or recursion limit exceeded
See https://github.com/zsh-users/zsh-syntax-highlighting/pull/749
Also rename `HISTORY_SUBSTRING_SEARCH_PREFIX` variable by adding "ED"
suffix so that it reads more like a special mode of operation rather
than an instruction to prepend a specified prefix to matched commands.
otherwise users are obliged to set the config values *after* sourcing
the plugin. They're not able to do it before. Also, re-sourcing the
plugin will reset the values to the defaults again.
A similar change was done in zsh-autosuggestions in the past:
https://github.com/zsh-users/zsh-autosuggestions/commit/9e4d3c3
* `HISTORY_SUBSTRING_SEARCH_PREFIX` is a global variable that defines
how the command history will be searched for your query. If set to a non-empty
value, only history prefixed by your query will be matched. For example,
if this variable is empty, `ls` will match `ls -l` and `echo ls`; if it is
non-empty, `ls` will only match `ls -l`.
Co-authored-by: Xue Qianming <qianmingxue@microsoft.com>
Add a new config variable that will anchor the history search to the beginning of the command.
Note that the default behavior does not change with this
Don't suggest using $terminfo[kcuu1] or $terminfo[cuu1] lookups anymore!
Instead, have the user observe the actual key codes for their arrow keys
using `cat -v` and then use those observed values to create keybindings.
This should eliminate confusion and complaints about binding arrow keys.
See https://github.com/zsh-users/zsh-history-substring-search/issues/63