diff options
author | Peter Stephenson <pws@zsh.org> | 2014-04-07 09:58:30 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2014-04-07 09:58:30 +0100 |
commit | 47c440aa2a141b1af60c2df192ff257b902dd177 (patch) | |
tree | e169916202fd08bef21d878a010e172efa7023fd /Functions/Zle | |
parent | 21d01000bee06c38dad3201f9609445d10b5de57 (diff) | |
download | zsh-47c440aa2a141b1af60c2df192ff257b902dd177.tar.gz zsh-47c440aa2a141b1af60c2df192ff257b902dd177.tar.xz zsh-47c440aa2a141b1af60c2df192ff257b902dd177.zip |
32527: zcalc-auto-insert key binding for use in zcalc
Diffstat (limited to 'Functions/Zle')
-rw-r--r-- | Functions/Zle/zcalc-auto-insert | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Functions/Zle/zcalc-auto-insert b/Functions/Zle/zcalc-auto-insert new file mode 100644 index 000000000..c9a5c8867 --- /dev/null +++ b/Functions/Zle/zcalc-auto-insert @@ -0,0 +1,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 |