From df2d935925498bba66a27bd51819ab0b9200863c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 7 Aug 2021 19:53:12 +0200 Subject: incdec: Ideas for bindings and getting point location A long time ago, I was trying to get this to work, but wasn't able to. Commit the code from then. Not really sure exactly what that was about now. --- incdec | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/incdec b/incdec index 15f4175..5981e43 100644 --- a/incdec +++ b/incdec @@ -17,5 +17,23 @@ function incdec { echo "$(($number + 1))" } +function __readline_incdec_incdec2 { + # echo "!!" + echo !# +} + # bind -x '"\C-xa+":incdec' # bind '"\C-xaa":\C-xa+' + +function __readline_incdec_save_readline_point { + __readline_incdec_readline_point="$READLINE_POINT" +} + +bind -x '"\C-xasrp": __readline_incdec_save_readline_point' + +# bind '"\C-xaa": \C-xasrp\C-c$(__readline_incdec_incdec2)\e\C-e' +# bind '"\C-xaa": \C-xasrp' +bind '"\C-xaa": __readline_incdec_incdec2' + + +# 2021.01.15: Idea: Maybe try using $EDITOR -- cgit v1.2.3