Use termcap info to decide Up/Down key.

This commit is contained in:
Gea-Suan Lin
2014-10-29 04:45:26 +08:00
parent 261b771d7c
commit 9f6d02109d

6
.zshrc
View File

@@ -59,11 +59,13 @@ precmd() {
bindkey -e
typeset -A key
key[Delete]=${terminfo[kdch1]}
key[Down]=${terminfo[kcud1]}
key[End]=${terminfo[kend]}
key[Home]=${terminfo[khome]}
key[Insert]=${terminfo[kich1]}
key[PageDown]=${terminfo[knp]}
key[PageUp]=${terminfo[kpp]}
key[Up]=${terminfo[kcuu1]}
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
@@ -74,8 +76,8 @@ key[PageUp]=${terminfo[kpp]}
autoload -Uz history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "" history-beginning-search-backward-end
bindkey "" history-beginning-search-forward-end
bindkey "${Key[Up]}" history-beginning-search-backward-end
bindkey "${Key[Down]}" history-beginning-search-forward-end
#
if [[ "`uname -s`" == "FreeBSD" || "`uname -s`" == "Darwin" ]]; then
alias "ls=/bin/ls -aFG"