Open keith-hall opened 7 years ago
I feel like I've read this before ...? But yeah, this is definitely a (known) error.
I had the idea I've mentioned it before, but I couldn't find it anywhere... if it is a dupe, I apologise!
I cannot reproduce keith-hall's original post. Further documentation on how to implement custom variables for snippets would be really appreciated.
I'm on the same boat. I could reproduce thee example, defining custom variables in a Default.tmPreferences
file under User
.
I can confirm that the documentation seems wrong.
The documentation is objectively wrong on this part. I haven't gotten around to working on it, however. Pull requests are welcome.
Ping on this. Any progress? I'm trying to get $TM_FULLNAME
an $TM_YEAR
in the Octave-function.sublime-snippet
from the Matlab package working, but not having any luck.
The snippets documentation refers to custom variables and states that they can be defined in
.sublime-options
files. https://github.com/guillermooo/sublime-undocs/blame/8a3b31288b1e329263c65701b5c133dc8755bc27/source/extensibility/snippets.rst#L105However, there is no other mention of
.sublime-options
files in the documentation, specifically, what file format they should be. Is this information actually true?In my experience, custom variables can be defined in
tmPreferences
files, in theshellVariables
dict section. As you know,shellVariables
are used to defineTM_COMMENT_START
andTM_COMMENT_END
, which can be used in snippets. Example: https://github.com/sublimehq/Packages/blob/4db940a44b74727ade298927d5ffdb8826fc9769/HTML/Comments.tmPreferences#L14-L16It therefore stands to reason that other variables can be defined here too. Example/proof:
Snippet:
Output when inserting snippet in a HTML file:
Therefore, please can the documentation be updated to reflect the facts.