about summary refs log tree commit diff
path: root/Completion/Builtins/_bindkey
blob: 91ecfcc28216a49e38ea7d47744d2f151905017f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#compdef bindkey

# Normally, this completes names of zle widgets, whether the builtin ones
# or ones defined by the user.  Note that a - allows a wildcard before it,
# so h-b-s-b will complete to history-beginning-search-backward.  You
# can alter this by removing the -M ... from the second compgen.
#
# Where appropriate, will complete keymaps instead of widgets.

if [[ "$words[2]" = -*[DAN]* || "$words[CURRENT-1]" = -*M ]]; then
  compadd - $(bindkey -l)
else
  compgen -b -M 'r:|-=* r:|=*'
fi