I love timestamp. I have keys in Vim for that. So I added a new keybinding for Bash shell:


# Timestamping
"\C-xt": "\"$(date --utc +%Y-%m-%dT%H:%M:%SZ)\" "

I use readline to input the string, the same trick I use to input quotation marks. I found no ways to grab the output of an external command in readline. So, a string with Command Substitution is the only option I have.

When I press Ctrl+X then t, the string "$(date --utc +%Y-%m-%dT%H:%M:%SZ) " will be entered and it will be replaced with the timestamp by Bash.