Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (24 sloc) 607 Bytes
editor:load "$argv[-1]"
if editor:keys:is-valid "$argv[-2]" || [[ "$argv[-2]" == *[\ +]* ]]; then
local bind
local -a parts
parts=("${(s/ /)argv[-2]}")
for part ("$parts[@]"); do
local -a keys
keys=("${(s/+/)part}")
for key ("$keys[@]"); do
if editor:keys:is-valid "$key"; then
if ! editor:keys:has "$key"; then
return 1
fi
bind="$bind$key_info[$key]"
else
bind="$bind$key"
fi
done
done
bindkey "${(@)argv[1,-3]}" "$bind" "$argv[-1]"
else
bindkey "$@"
fi
# vim: ft=zsh sts=2 ts=2 sw=2 et fdm=marker fmr={{{,}}}
Something went wrong with that request. Please try again.