Use terminfo for up/down keys

This commit is contained in:
Thomas Avé 2022-08-09 15:04:34 +02:00
parent ebe8f74a8c
commit 2505ffd2a0
2 changed files with 2096 additions and 2 deletions

2081
zsh/.zcompdump Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,13 +13,26 @@ zstyle ':completion:*' menu select
# Use cd without cd
setopt autocd
# Make sure that the terminal is in application mode when zle is active, since
# only then values from $terminfo are valid
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
# Make sure that search using up works
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search # Up
bindkey "^[[B" down-line-or-beginning-search # Down
bindkey "$terminfo[kcuu1]" up-line-or-beginning-search # Up
bindkey "$terminfo[kcud1]" down-line-or-beginning-search # Down
# Use Home, End to go to beginning or end of lines
bindkey "^[[H" beginning-of-line