You can use it to search back in history with C-r and then execute that command with C-o and keep pressing C-o to execute the commands that followed that one in history. Very helpful for executing a whole block of history.
For some reason, this documentation is hard to find! It's not here, for example:
Another obscure readline feature is that ~/.inputrc accepts key sequences bound to arbitrary (quoted) macros, including macros that contain more key sequences.
# a basic macro that types "foo" bound to META+"f"
"\ef": "foo"
The cool part is that bash recursively checks the macro output for more key sequences. For example, I use these standard bindings:
I have since gotten out of the habit, but when I was just starting out I gave myself CTS one Christmas doing a giant refactor with just vi to remove a disasterous idiom from the codebase that was O(n^2).
I knew a quite a few commands but I didn’t know the block indentation commands and that was about a third of my typing over that week.
After that, part of my regular “I’m tired or there’s nothing to work on” routine included reading the accelerator key documentation for my editor of choice. I found all sorts of good stuff and it really made me faster for quite some time. Now I do more analysis work and the accelerators that help there are less numerous. Fast code nav being a critical one.
But some of these tools make it pretty hard to find all their features, which is a shame.
My favourite little-known readline command is operate-and-get-next:
https://www.gnu.org/software/bash/manual/html_node/Miscellan...
You can use it to search back in history with C-r and then execute that command with C-o and keep pressing C-o to execute the commands that followed that one in history. Very helpful for executing a whole block of history.
For some reason, this documentation is hard to find! It's not here, for example:
http://readline.kablamo.org/emacs.html
I'm a bit saddened when readline replacements don't implement C-o. For example, the Python REPLs don't have it.