Sublime Forum

Snippet Segregation

#1

I am trying to segregate my snippets without using scope, as that has at time caused me issues where things just did not show up, and instead using folder organization. So in other words I have four folders setup:

  • /CSS/

  • /HTML/

  • /JavaScript/

  • /PHP/

… in my /Users/ folder.

I have snippets for a particular thing I do in CSS, HTML, and JavaScript and intended on using the same tabTrigger knowing that each would be in their own folder and therefore only show up if the specific syntax was being used, or file open. Here is a screenshot example of what I thought would not happen @ grab.by/gPuO. Basically what we’re seeing is that by typing ‘qcmodal’ I am getting a drop down with all three of my snippets even though they are in three different language folders. I changed the tabTriggers to be ‘-lang’ at the end since ‘qcmodal’ [tab] outputted my CSS snippet whether I was in a .js file, .php file, or .css file.

What am I doing wrong? =)

Cheers,
Frank

0 Likes

#2

You need to use the scope attribute within the snippet file to do this

1 Like

#3

Hmm, my mistake. I must have heard Jeffrey Way incorrectly on his screencast where I thought folder separation would be fine enough.

EDIT: Let me ask this then, if I have ‘qcmodal’ for multiple languages and I use scope in those snippets – will that cause any issues?

0 Likes

#4

Answered my own question. Yes you can use the same tabTrigger with multiple snippets if the scope is different.

0 Likes