From 7250469c78b98a124e844ea6733d188695d2b888 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 9 Jan 2021 16:50:27 +0100 Subject: Idea for a Readline binding to increment/decrement a number Want something similar to and 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, 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. --- Idea.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Idea.txt (limited to 'Idea.txt') 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 and . + +2021.01.03: +Try C-c and replace the number in a new shell line -- cgit v1.2.3