Use terminfo for up/down keys
This commit is contained in:
parent
ebe8f74a8c
commit
2505ffd2a0
File diff suppressed because it is too large
Load Diff
17
zsh/.zshrc
17
zsh/.zshrc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue