Created
April 23, 2020 11:53
-
-
Save elig0n/9e7011a11dcacd502d68811f3f5fb108 to your computer and use it in GitHub Desktop.
Display bash-like (args: N) when using multipliers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display NUMERIC too | |
zle -N digit-argument _digit_argument | |
zle -N neg-argument _digit_argument | |
function _digit_argument () { | |
if [[ $WIDGET = neg-argument ]]; then | |
if [[ -n $NUMERIC ]]; then | |
zle -M - "" | |
else | |
zle -M - - | |
fi | |
elif [[ $LASTWIDGET = neg-argument ]]; then | |
zle -M - "$((NUMERIC * $KEYS[-1] ? NUMERIC * $KEYS[-1] : $KEYS[-1]))" | |
else | |
zle -M - "(arg: $NUMERIC$KEYS[-1])" | |
fi | |
zle .$WIDGET | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment