Sublime Forum

Invoke snippets within .sublime-snippet

#1

Hey everyone!

Not sure I am missing something, but when having declared a snippet’s scope to “source”, I’d expect it to work within .sublime-snippet files so I can use snippets to write snippets. Is this supposed to work or expected?

Best wishes,
Shu

0 Likes

#2

.sublime-snippet is text.xml though. ctrl+alt+shift+p to show the scope at the caret.

0 Likes

#3

Thanks for the reply! So I’d have to specify that? I’d like my snippets to run in any file type, for which I read specifying “source” is required.

0 Likes

#4

That won’t match text.xml obviously. You either use text, which works in all text, or use text.xml, which only works in text.xml and something like text.xml.foo.bar.baz.etc.

For literally everything, use text | source | embedding for historical reason. embedding is probably previously only used in PHP.

For details about selector matching, see https://www.sublimetext.com/docs/selectors.html

0 Likes

#5

Awesome! Thanks! That’s great info! I’ll look into this further!

0 Likes