about summary refs log tree commit diff
path: root/Completion/Builtins/_bindkey
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Builtins/_bindkey')
-rw-r--r--Completion/Builtins/_bindkey39
1 files changed, 21 insertions, 18 deletions
diff --git a/Completion/Builtins/_bindkey b/Completion/Builtins/_bindkey
index 048d517f2..45471feb5 100644
--- a/Completion/Builtins/_bindkey
+++ b/Completion/Builtins/_bindkey
@@ -7,31 +7,34 @@
 #
 # Where appropriate, will complete keymaps instead of widgets.
 
-local state expl line curcontext="$curcontext"
+local state expl line curcontext="$curcontext" ret=1
 typeset -A opt_args
 
-_arguments -C -s \
-  '(-v -a -M -l -D -A -N)-e[select emacs keymap and bind it to main]' \
-  '(-e -a -M -l -D -A -N)-v[select viins keymap and bind it to main]' \
-  '(-e -v -M -l -D -A -N)-a[select vicmd keymap]' \
-  '(-e -v -a -l -D -A -N)-M[specify keymap to select]:keymap:->keymap' \
-  '(-e -v -a -M -D -A -N -m -r -s -R *)-l[list existing keymap names]' \
+_arguments -C -s -S \
+  '(-v -a -M -l -D -A -N -p)-e[select emacs keymap and bind it to main]' \
+  '(-e -a -M -l -D -A -N -p)-v[select viins keymap and bind it to main]' \
+  '(-e -v -M -l -D -A -N -p)-a[select vicmd keymap]' \
+  '(-e -v -a -l -D -A -N -p)-M[specify keymap to select]:keymap:->keymap' \
+  '(-e -v -a -M -D -A -N -m -p -r -s -R *)-l[list existing keymap names]' \
   '(-e -v -a -d -A -N -m -r -s -R *)-L[output in form of bindkey commands]' \
-  '(-e -v -a -l -D -A -N -m -r -s -R *)-d[delete existing keymaps and reset to default state]' \
-  '(-e -v -a -M -l -d -A -N -m -r -s -R *)-D[delete named keymaps]:*:keymap:->keymap' \
-  '(-e -v -a -M -l -L -d -D -N -m -r -s -R *)-A[create alias to keymap]:old-keymap:->keymap:new-keymap:->keymap' \
-  '(-e -v -a -M -l -L -d -D -A -m -r -s -R *)-N[create new keymap]:new-keymap:->keymap:old-keymap to copy:->keymap' \
-  '(-l -L -d -D -A -N -r -s -r -R *)-m[add builtin meta-key bindings to selected keymape]' \
-  '(-l -L -d -D -A -N -m -s *)-r[unbind specified in-strings]:*:in-string' \
-  '(-l -L -d -D -A -N -m -r *)-s[bind each in-string to each out-string]:*:key string' \
-  '(-e -v -a -M -l -L -d -D -A -N -m)-R[interpret in-strings as ranges]' \
-  '(-l -L -d -A -N -m -r -s)*::widgets:->widget' && return 0
+  '(-e -v -a -l -D -A -N -m -p -r -s -R *)-d[delete existing keymaps and reset to default state]' \
+  '(-e -v -a -M -l -d -A -N -m -p -r -s -R *)-D[delete named keymaps]:*:keymap:->keymap' \
+  '(-e -v -a -M -l -L -d -D -N -m -p -r -s -R *)-A[create alias to keymap]:old-keymap:->keymap:new-keymap:->keymap' \
+  '(-e -v -a -M -l -L -d -D -A -m -p -r -s -R *)-N[create new keymap]:new-keymap:->keymap:old-keymap to copy:->keymap' \
+  '(-l -L -d -D -A -N -p -r -s -r -R *)-m[add builtin meta-key bindings to selected keymape]' \
+  '(-e -v -a -M -d -D -A -N -m -r -s -R *)-p[list bindings which have given key sequence as a prefix]:key sequence' \
+  '(-l -L -d -D -A -N -m -p -s *)-r[unbind specified in-strings]:*:in-string' \
+  '(-l -L -d -D -A -N -m -p -r *)-s[bind each in-string to each out-string]:*:key string' \
+  '(-e -v -a -M -l -L -d -D -A -N -m -p)-R[interpret in-strings as ranges]' \
+  '(-l -L -d -A -N -m -p -r -s)*::widgets:->widget' && ret=0
 
 case $state in
   keymap)
-    _wanted -C -M keymaps expl keymap compadd -a keymaps
+    _wanted -C -M keymaps expl keymap compadd -a keymaps && ret=0
   ;;
   widget)
-    _wanted widgets expl widget compadd -M 'r:|-=* r:|=*' -k widgets
+    _wanted widgets expl widget compadd -M 'r:|-=* r:|=*' -k widgets && ret=0
   ;;
 esac
+
+return ret