1
0
Fork 0
mirror of synced 2024-06-29 03:31:10 -04:00
zimfw/modules/history-substring-search/init.zsh
Eric Nielsen fe2cb6b9f5 [history-substring-search] Fix incompatibility with zle-line-init widget
See https://github.com/zsh-users/zsh-history-substring-search/issues/70
and comment by @molovo:

     I was already binding keys _after_ `zle-line-init`, but I'm pulling
     keycodes out of the `terminfo` module, which reports up
     (`$terminfo[kcuu1]`) as `^[0A` instead of `^[[A`. Binding `^[[A`
     manually mean up/down works with history-substring-search both
     before and after `zle-line-init`, but if I bind `$terminfo[kcuu1]`
     (`^[0a`), up/down only works *before* `zle-line-init`.

Closes #286
2018-09-16 12:01:52 -05:00

11 lines
335 B
Bash

#
# Enable searching history with substrings
#
# Source script
source ${0:h}/external/zsh-history-substring-search.zsh || return 1
# Binding ^[[A/^[[B manually mean up/down works with history-substring-search both before and after zle-line-init
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down