summary refs log tree commit diff
path: root/Functions/Zle/zcalc-auto-insert
blob: c9a5c8867a29973752a253b58cd105c5f71ec945 (plain) (blame)
1
2
3
4
5
6
7
8
# Bind to a binary operator keystroke for use with zcalc

if [[ -n $ZCALC_ACTIVE ]]; then
  if [[ $CURSOR -eq 0 || $LBUFFER[-1] = "(" ]]; then
    LBUFFER+=${ZCALC_AUTO_INSERT_PREFIX:-"ans "}
  fi
fi
zle .self-insert