Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 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

 
discard

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.