diff options
author | Dan McGregor <dan.mcgregor@usask.ca> | 2017-08-10 14:15:11 -0600 |
---|---|---|
committer | Dan McGregor <dan.mcgregor@usask.ca> | 2017-08-22 09:14:19 -0600 |
commit | 681d12f8bf04a403d6e692cbe0ceebad932b0731 (patch) | |
tree | e90e95df7820892273c68f446e4460cd8a9e5269 /meta-oe/recipes-extended/zsh/files/zshrc | |
parent | 1ce7c78756539126eb7a9037ac257b91c07312a5 (diff) | |
download | meta-openembedded-contrib-681d12f8bf04a403d6e692cbe0ceebad932b0731.tar.gz |
zsh: update to 5.4.1dankm/zsh
Also fix up autoconf to use pkg-config, and properly detect pcre.
Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Diffstat (limited to 'meta-oe/recipes-extended/zsh/files/zshrc')
-rw-r--r-- | meta-oe/recipes-extended/zsh/files/zshrc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/zsh/files/zshrc b/meta-oe/recipes-extended/zsh/files/zshrc new file mode 100644 index 0000000000..37918523a9 --- /dev/null +++ b/meta-oe/recipes-extended/zsh/files/zshrc @@ -0,0 +1,45 @@ +# /etc/zshrc: system-wide .zshrc file for zsh(1). +# +# This file is sourced only for interactive shells. It +# should contain commands to set up aliases, functions, +# options, key bindings, etc. +# +# Global Order: zshenv, zprofile, zshrc, zlogin + +typeset -A key + +key[Home]=${terminfo[khome]} +key[End]=${terminfo[kend]} +key[Insert]=${terminfo[kich1]} +key[Delete]=${terminfo[kdch1]} +key[Up]=${terminfo[kcuu1]} +key[Down]=${terminfo[kcud1]} +key[Left]=${terminfo[kcub1]} +key[Right]=${terminfo[kcuf1]} +key[PageUp]=${terminfo[kpp]} +key[PageDown]=${terminfo[knp]} + +# setup key accordingly +[[ -n "${key[Home]}" ]] && bindkey -e "${key[Home]}" beginning-of-line +[[ -n "${key[End]}" ]] && bindkey -e "${key[End]}" end-of-line +[[ -n "${key[Insert]}" ]] && bindkey -e "${key[Insert]}" overwrite-mode +[[ -n "${key[Delete]}" ]] && bindkey -e "${key[Delete]}" delete-char +[[ -n "${key[Up]}" ]] && bindkey -e "${key[Up]}" up-line-or-history +[[ -n "${key[Down]}" ]] && bindkey -e "${key[Down]}" down-line-or-history +[[ -n "${key[Left]}" ]] && bindkey -e "${key[Left]}" backward-char +[[ -n "${key[Right]}" ]] && bindkey -e "${key[Right]}" forward-char + +unset key + +# Finally, make sure the terminal is in application mode, when zle is +# active. Only then are the values from $terminfo valid. +function zle-line-init () { + emulate -L zsh + printf '%s' $terminfo[smkx] +} +function zle-line-finish () { + emulate -L zsh + printf '%s' $terminfo[rmkx] +} +zle -N zle-line-init +zle -N zle-line-finish |