Dynamic snippet text in snippets.cson


I’d like to dynamically include the current date/time in a snippet for markdown.
The snippet would look something like this.

    'prefix': 'header'
    'body': 'My name - `Date.today.strftime('%D')`'

which would print:

My name - 4/2/14

Date.today.strftime(’%D’) is Ruby, the equivalent js a little longer (unless there’s an easier way):

var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
var curr_year = d.getFullYear();
console.log(curr_month + "/" + curr_date + "/" + curr_year);


Snippets that use env variables or local variables

Interesting idea. Could you open up an issue on the https://github.com/atom/snippets repo?


I just created an issue on github.