zshrc: unfunction less utilities
[grml-etc-core.git] / etc / zsh / zshrc
index 04443a8..bc2d21c 100644 (file)
@@ -406,6 +406,7 @@ check_com() {
 salias() {
     emulate -L zsh
     local only=0 ; local multi=0
+    local key val
     while [[ $1 == -* ]] ; do
         case $1 in
             (-o) only=1 ;;
@@ -495,11 +496,7 @@ xcat() {
 xunfunction() {
     emulate -L zsh
     local -a funcs
-    funcs=(salias xcat xsource xunfunction zrcautoload
-                                           zrcautozle
-                                           zrcbindkey
-                                           zrcgotkeymap
-                                           zrcgotwidget)
+    funcs=(salias xcat xsource xunfunction zrcautoload zrcautozle)
     for func in $funcs ; do
         [[ -n ${functions[$func]} ]] \
             && unfunction $func
@@ -1313,7 +1310,7 @@ zstyle ':completion:hist-complete:*' completer _history
 typeset -ga grml_missing_features
 
 function zrcbindkey() {
-    if (( ARGC && ${+widgets[${argv[-1]}]} )); then
+    if (( ARGC )) && zrcgotwidget ${argv[-1]}; then
         bindkey "$@"
     fi
 }
@@ -1392,6 +1389,7 @@ bind2maps       viins vicmd -- Right  vi-forward-char
 bind2maps       viins vicmd -- Right  vi-forward-char
 
 if zrcgotkeymap menuselect; then
+    #m# k Shift-tab Perform backwards menu completion
     bind2maps menuselect -- BackTab reverse-menu-complete
 
     #k# menu selection: pick item but stay in the menu
@@ -1443,13 +1441,6 @@ zrcbindkey "\e[6~" history-beginning-search-forward-end  # PageDown
 #k# Insert Unicode character
 zrcbindkey '^xi' insert-unicode-char
 
-#m# k Shift-tab Perform backwards menu completion
-if [[ -n "$terminfo[kcbt]" ]]; then
-    zrcbindkey "$terminfo[kcbt]" reverse-menu-complete
-elif [[ -n "$terminfo[cbt]" ]]; then # required for GNU screen
-    zrcbindkey "$terminfo[cbt]"  reverse-menu-complete
-fi
-
 #k# Toggle abbreviation expansion on/off
 zrcbindkey '^xA' grml_toggle_abbrev
 zrcbindkey "^x^h" commit-to-history