X-Git-Url: https://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=etc%2Fzsh%2Fzshrc;h=89b64bf8d9c9589a934fcf028e5e630b5796a296;hb=fe6aa2b61878209afc8e9fcf80b0c8bdda1747ce;hp=b7cb2e5f353210b6dc0b74df7188ec35b5159644;hpb=78d890c776564875326d0ab41e8ed80ee1c6c0ab;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index b7cb2e5..89b64bf 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -242,7 +242,7 @@ function zrcautoload() { local -i ffound ffile=$1 - (( found = 0 )) + (( ffound = 0 )) for fdir in ${fpath} ; do [[ -e ${fdir}/${ffile} ]] && (( ffound = 1 )) done @@ -555,7 +555,7 @@ isdarwin && xsource /sw/bin/init.sh # load our function and completion directories for fdir in /usr/share/grml/zsh/completion /usr/share/grml/zsh/functions; do fpath=( ${fdir} ${fdir}/**/*(/N) ${fpath} ) - if [[ ${fpath} == '/usr/share/grml/zsh/functions' ]] ; then + if [[ ${fdir} == '/usr/share/grml/zsh/functions' ]] ; then for func in ${fdir}/**/[^_]*[^~](N.) ; do zrcautoload ${func:t} done @@ -585,6 +585,22 @@ watch=(notme root) # automatically remove duplicates from these arrays typeset -U path cdpath fpath manpath +# Remove zle-line-{init,finish} if it looks like it turns smkx. This would be +# better fixed by working with those modes too, but we use way too many +# hardcoded bindings for now. +function remove_widget () { + local name=$1 + local cap=$2 + if (( ${+functions[$name]} )) && [[ ${functions[$name]} == *${cap}* ]]; then + local w=${widgets[$name]} + zle -D $name + [[ $w == user:* ]] && unfunction ${w#*:} + fi +} +remove_widget zle-line-init smkx +remove_widget zle-line-finish rmkx +unfunction remove_widget + # keybindings if [[ "$TERM" != emacs ]] ; then [[ -z "$terminfo[kdch1]" ]] || bindkey -M emacs "$terminfo[kdch1]" delete-char