1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00
zsh/Functions/Zle/zcalc-auto-insert
2016-06-16 11:39:42 +01:00

9 lines
267 B
Text

# Bind to a binary operator keystroke for use with zcalc
# Not useful in RPN mode.
if [[ -n $ZCALC_ACTIVE && $ZCALC_ACTIVE != rpn ]]; then
if [[ $CURSOR -eq 0 || $LBUFFER[-1] = "(" ]]; then
LBUFFER+=${ZCALC_AUTO_INSERT_PREFIX:-"ans "}
fi
fi
zle .self-insert