Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

added special variables #83

Closed
wants to merge 4 commits into from
Closed

Conversation

mark-hahn
Copy link

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 they 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 and paths

  • ${/filename} => /root/proj/lib/main.coffee
  • ${/dirname} => /root/proj/lib
  • ${/basename} => main.coffee
  • ${/extname} => .coffee
  • ${/sep} => /
  • ${/delimiter} => :
  • ${/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 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

@mark-hahn mark-hahn mentioned this pull request Nov 23, 2014
@pathawks pathawks mentioned this pull request Jan 13, 2015
@steveoh
Copy link

steveoh commented Jun 3, 2015

why did the build fail on this? I would love for this to be merged!

refs #148

@raulghm
Copy link

raulghm commented Jul 6, 2015

+1 why this build fail?

@leo-cheron
Copy link

Special variables are fundamental to unleash snippets power. Any news on this merge?

@mark-hahn
Copy link
Author

It needs someone to take over and fix it.

On Tue, Sep 1, 2015 at 9:20 AM, Léo Chéron notifications@github.com wrote:

Special variables are fundamental to unleash snippets power. Any news on
this merge?


Reply to this email directly or view it on GitHub
#83 (comment).

@gries
Copy link

gries commented Sep 18, 2015

👍 looking forward for this to be merged :)

@bsr203
Copy link

bsr203 commented Sep 18, 2015

+1

@jacwah jacwah mentioned this pull request Sep 20, 2015
@dsturm
Copy link

dsturm commented Nov 16, 2015

+1

@cabloo
Copy link

cabloo commented Nov 30, 2015

+1

A useful additional feature would be the ability to run keybindings or commands from a specific package.

@dbackeus
Copy link

dbackeus commented Dec 9, 2015

+1

@kafoso
Copy link

kafoso commented Dec 10, 2015

+1

Definitely mandatory features in a hackable editor!

@jmetz
Copy link

jmetz commented Mar 10, 2016

+1

@damieng
Copy link
Contributor

damieng commented Sep 27, 2016

Closing in favor of #173

@damieng damieng closed this Sep 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.