atom/snippets — pull request #83 by mark-hahn (2014-11-23 23:15:25+00:00)
Title: added special variables

Adds variables like `${/filename}` that expand into special values, much like `__filename` in node. The prefix character is designed to not conflict with normal variable names if/when they are supported. I don't know where docs are supposed to go so here that are ...

### Special variables in snippets package

Add variables of the form `${Xname}` where the first character `X` is one of `/`, `:`, or `-`. The suffix `name` must follow specific values or syntax. Examples ...

### files
- **${/filename}** => /root/proj/lib/main.coffee
- **${/dirname}** => /root/proj/lib
- **${/basename}** => main.coffee
- **${/extname}** => .coffee
- **${/sep}** => /
- **${/deliminator}** => :
- **${/projectpath}** => /root/proj
- **${/project}** => proj
- **${/filenamerel}** => lib/main.coffee
- **${/dirnamerel}** => lib
- **${/line}** => 27 (line number of cursor position)

### date & times
- **${-any-moment-format}** current time in any format provided by the [moment](http://momentjs.com/) npm package
- ${-MMMM Do YYYY, h:mm:ss a} => November 22nd 2014, 2:24:26 am
- ${-dddd} => Saturday
- ${-MMM Do YY} => Nov 22nd 14

### package.json
- **${:path:in:project:json}** Shows value from project.json file
- ${:name} => moment
- ${:version} => 2.8.4
- ${:repository:url} => https://github.com/moment/moment.git