CZ8. SublimeText : Add Snippets

This post is part of a series starting with

In this post I will add snippets to SublimeText.

Snippets should be divided into folders, that has the same name as the syntax, so they appear in the right context.

  • Create snippet template with
    • Tools – New snippet…

Snippets without scope

WordPress snippets


The snippet is for posting souce code into WordPress.

The below snippet don’t show right in the browser.

You must replace “<“code with “[“code. And likewise for the rest of the <> brackets used with “code”.

<code language="${1:javascript}">
  • ctrl-s – “WordPress-code.sublime-snippet” -Save
  • To use: write “wp” ctrl-space

Snippets with scope

JavaScript snippets


<!-- From -->
(function() {
  • ctrl-s – <make dir “JavaScript”> – goto \JavaScript\ – “SelfInvokingAnonymousFunction.sublime-snippet” -Save
  • To use: In .js write “siaf” ctrl-space

Thanks to NetTuts for the lesson.

The End.

One Comment

Add yours →

  1. The default snippet folder is:
    C:\Users\youruserid\AppData\Roaming\Sublime Text 3\Packages\User

    More info:

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: