4

My coworker has this nifty key combination he types in when touching a new file that expands out the current timestamp (YYYYMMDDHHMMSS) to where the cursor is, so he can quickly create timestamped schema migration files, etc.

Alas, he's on vacation and I don't have access to his .zshrc file, and have been unsuccessful at finding out how to do this through Google. Does anyone know how to do this?

1 Answer 1

5

Try this:

function unix_ts { LBUFFER="${LBUFFER}$(date '+%Y%m%d%H%M%S')" }
zle -N unix_ts
bindkey "^t" unix_ts

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .