Sublime Forum

Snippets for specific language

#1

Hi!

I’ve been able to create new snippets. However, they appear always, no matter which programming language I choose.

I tried to follow the tutorials and I’ve put a snippet in a new folder called “C++” and expected to get my custom snippets only offered when I’m using the C++ syntax. Still, if I set the syntax to javascript or java, I still get access to these snippets. As far as I noticed only when I’m in plain-text mode I don’t get access to the snippets.

Can anyone help me and give me more precise instructions on how to achieve this? Is it some very specific place where I have to store this folder?

Maybe the problem is because I’m using sublime-3 and the tutorials are for sublime-2?
Or maybe because I’m using ubuntu 14.04 and the tutorials where for mac users?

as just mentioned I’m running:
sublime 3
gnome ubuntu 14.04

thx in advance.
Cheers

0 Likes

#2

Ok. I think I found the solution.

there is a scope tag in the snippet file. Just set it to:
source.c++

0 Likes