X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=4e7ef0906066b2a99f67db21052353128b35a5e0;hp=4f0da7edec7913748ce5761514d0b9bfdde07645;hb=8564319c233b615c6b2500f166cfdcc0e8d1185c;hpb=33098236a1e383685f45ead5ed1af047ee96a036 diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 4f0da7e..4e7ef09 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -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