How to create snippets in sublime ?

How to create snippets in sublime ?

In this post we will give you information about How to create snippets in sublime ?. Hear we will give you detail about How to create snippets in sublime ?And how to use it also give you demo for it if it is necessary.

nowdays sublime is a very popular text edir in the developing field. sublime text editor is provide lots of packages like code formatter, php syntax etc. sublime is also provide snippet. snippet is very intrsting point because if you need to write same code lots of time than you can create shortcut name for that command content. For example if you want to write text “lorem ipsum” then you can just write just “lorem” and get whole lorem text. In following example i create snippet “debug” for debug code of PHP.

If you write just “debug” you can find autocomplete with debug snippet and just click on it and find follwing code.

Name Of Snippet

debug

Snippet Result

echo "<pre>";print_r(this);exit;

First Click on “tools” on menubar and click at last “New snippet…” then can see new file open and put following code.

Snippet Code

<snippet>

<content><![CDATA[

echo "<pre>";print_r(${1:this});exit;

]]></content>

<tabTrigger>dbug</tabTrigger>

<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->

<!-- <tabTrigger>hello</tabTrigger> -->

<!-- Optional: Set a scope to limit where the snippet will trigger -->

<!-- <scope>source.python</scope> -->

</snippet>

and save name should “dbug.sublime-snippet” and then write “dbug” on your php file and try this….

Hope this code and post will helped you for implement How to create snippets in sublime ?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

20  +    =  25

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US