aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-08-07 19:53:12 +0200
committerTeddy Wing2021-08-07 19:53:12 +0200
commitdf2d935925498bba66a27bd51819ab0b9200863c (patch)
tree9c0bb17f733cb5efd2e5cb291b454eb5080b13e1
parent7250469c78b98a124e844ea6733d188695d2b888 (diff)
downloadreadline-incdec-df2d935925498bba66a27bd51819ab0b9200863c.tar.bz2
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.
-rw-r--r--incdec18
1 files changed, 18 insertions, 0 deletions
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