I can not find a way to do that from bash. So Is there a way to define a bash readline shortcut that will insert a dynamically generated string at the position of the cursor?
E.g., I want to insert date:
bind '"\C-xx": my-dynamical-date'
aaa bbb
--------
^ cursor is here
# After pressing "\C-xx":
aaa Sun Apr 22 22:19:00 CST 2018 bbb
------------------------------------
^ cursor is here
So how to define my-dynamical-date readline command?
bind '"^M":"\nmy-alias\n"'
– Arkadiusz Drabczyk Apr 22 '18 at 13:50