1

I would like to create a yasnippet snippet which will insert automatically the current timestamp. I have found a code which actually prints the timestamp but I do not know how to integrate into a yasnippet snippet. Any way to do this?

Example. I would like that pressing "weather" and then TAB I get 2017-07-29, time = so I can type the weather.

Drew
  • 75,699
  • 9
  • 109
  • 225
Nisba
  • 895
  • 8
  • 19

1 Answers1

2

As with this recent question, you can use embedded Emacs-lisp code.

# -*- mode: snippet -*-
# key: weather
# --
`(format-time-string "%Y-%m-%d, time = ")`$0
Kyle Meyer
  • 6,914
  • 26
  • 22