Sublime Forum

Snippets documentation?

#1

Jon,

First, I was specifically looking to see if I could use the same vars available in builder (i.e. $BaseName, $FileName, etc…) in a snippet. It appears not.

In my quest, I went to: sublimetext.com/docs/snippets, which is the URL in a auto-generated snippet. This page is not yet populated. Would be nice to have a little consolidated docs on snippets. I can take a stab at content ideas if you’d like of even help contribute.

Lemme know…

Greg

0 Likes

#2

If you’re keen to contribute some docs, that’d be great.

For reference, the supported variables are:

SELECTION (the current selection when the snippet was triggered)
PARAM1, PARAM2, etc (arguments passed to the insertSnippet command)
TM_SELECTED_TEXT
TM_LINE_INDEX
TM_LINE_NUMBER
TM_FILEPATH
TM_FILENAME
TM_CURRENT_WORD
TM_CURRENT_LINE
TM_FULLNAME
TM_TAB_SIZE
TM_SOFT_TABS

0 Likes

#3

Where do I set variables like TM_FULLNAME? I cannot find anything anywhere on this for Sublime Text 2.

Thanks

0 Likes

#4

You don’t set them… they’re already set for you

0 Likes