Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

Try this:

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.