Sublime Forum

Is it possible to make snippets for one file?

#1

I try to create a snippet in sublimetext 2 so I can for one snippet but for a several I can’t so I would like to know if it is possible to create all snippets for one file for example those 2 class

   <snippet>
	<content>
		<![CDATA[

        class ${1:Name_Class} extends CI_Controller 
	{

       public function __construct()
       {
            parent::__construct();
          
       }
       
       public function ${2:index}()
       {
           
          
       }
	}
]]>
       </content>
	<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
	 <tabTrigger>class_controller</tabTrigger> 
	<!-- Optional: Set a scope to limit where the snippet will trigger -->
	<!-- <scope>source.python</scope> -->
</snippet>

<snippet>
	<content>
		<![CDATA[

class ${1:Name_Class} extends CI_Model 
	{

       public function __construct()
       {
            parent::__construct();
          
       }
       
       public function ${2:Name_function}()
       {
           
          
       }
	}
]]>
</content>
	<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
	 <tabTrigger>class_model</tabTrigger> 
	<!-- Optional: Set a scope to limit where the snippet will trigger -->
	<!-- <scope>source.python</scope> -->
</snippet>

the firs class_controller works but not the class model !!
I don’t know if it 's necessary to create 1 snippet for 1 file

thanks

0 Likes