aboutsummaryrefslogtreecommitdiffstats
path: root/Idea.txt
diff options
context:
space:
mode:
authorTeddy Wing2021-01-09 16:50:27 +0100
committerTeddy Wing2021-01-09 16:50:27 +0100
commit7250469c78b98a124e844ea6733d188695d2b888 (patch)
tree85cab0086756acaf5b4cf99e538d6a347fb54e41 /Idea.txt
downloadreadline-incdec-7250469c78b98a124e844ea6733d188695d2b888.tar.bz2
Idea for a Readline binding to increment/decrement a number
Want something similar to <C-a> and <C-x> in Vim. This function matches and increments the number, but I'm currently stymied on how to insert the number into the current line. There doesn't appear to be a way to do that, except perhaps with the `shell-expand-line` function, and I don't want to use that because I just want to insert the number, not expand other parts of the shell line. The other sticking point is how to read the value of the `universal-argument`. There doesn't currently seem to be a way to do that in a custom function. I had a new idea for the number insertion problem, though. It's possible I could replace the number, <C-c> the line, and reinsert a new copy with the incremented/decremented number on the new shell line. That still wouldn't resolve the `universal-argument` problem.
Diffstat (limited to 'Idea.txt')
-rw-r--r--Idea.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/Idea.txt b/Idea.txt
new file mode 100644
index 0000000..5a47f60
--- /dev/null
+++ b/Idea.txt
@@ -0,0 +1,4 @@
+Readline bindings to increment and decrement a number on the command line, like Vim's <C-a> and <C-x>.
+
+2021.01.03:
+Try C-c and replace the number in a new shell line