Hacker News new | ask | show | jobs
by zx_q12 463 days ago
Timestamped notes/lines are great, I've had these in my .vimrc for years

  "insert date
  iabbrev <expr> dts strftime("\* %D - %A\n\t")
  "insert datetime
  iabbrev <expr> dtt strftime("%D %H:%M:%S:")
1 comments

For the uneducated, how do you use those? Is there a way to insert those automatically, just like the submission does?
Those are basically string-replacements. Add those lines to .vim/vimrc, and when you type "dtt" or "dts" that text gets replaced with a time/date stamp.

Kinda useful if you want to manually add date/time to lines, but a different thing.

I got it. One enters `dtt`, or `dts` and space. It gets replaced by date, or timestamp accordingly. Pretty neat!