mirror of
https://github.com/zsh-users/zsh-history-substring-search.git
synced 2026-11-11 11:41:49 -05:00
GH-21: bind arrow key codes according to terminfo
This commit is contained in:
committed by
Suraj N. Kurapati
parent
99341be866
commit
d9b28ed7f9
@@ -30,11 +30,9 @@ Usage
|
|||||||
2. Bind keyboard shortcuts to this script's functions:
|
2. Bind keyboard shortcuts to this script's functions:
|
||||||
|
|
||||||
# bind UP and DOWN arrow keys
|
# bind UP and DOWN arrow keys
|
||||||
for keycode in '[' 'O'; do
|
zmodload zsh/terminfo
|
||||||
bindkey "^[${keycode}A" history-substring-search-up
|
bindkey "$terminfo[kcuu1]" history-substring-search-up
|
||||||
bindkey "^[${keycode}B" history-substring-search-down
|
bindkey "$terminfo[kcud1]" history-substring-search-down
|
||||||
done
|
|
||||||
unset keycode
|
|
||||||
|
|
||||||
# bind P and N for EMACS mode
|
# bind P and N for EMACS mode
|
||||||
bindkey -M emacs '^P' history-substring-search-up
|
bindkey -M emacs '^P' history-substring-search-up
|
||||||
|
|||||||
Reference in New Issue
Block a user