Sublime Text 2 – my snippets -

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

Using shortcuts, you can call your own snippets.

Register your own snippets

  1. [Tools] > [New Snippet...]
  2. Edit & Save the new snippet file

<tabTrigger> is the actual shortcut code. In the case above, typing “fire” & tab key provides you the snippet saying “This is my first snippet!”.

Unless there is a special restriction, you do not need to set <scope> the option which means every file applies the snippet.

Save the file with the extension “.sublime-snippet” in the folder “/Users/{your account}/Library/Application Support/Sublime Text 2/User”.

If you have “$” in your content, please escape it with “\”.

My snippets

Let me introduce some of my snippets.

jQuery

Backbone.js & Require.js

Requre.config
Router
Model
View

Sublime-Text-2-Inc-Dec-Value

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

Useful package for Sublime Text 2 to inclement / decrement numbers, values, date, hex colors.
Sublime-Text-2-Inc-Dec-Value

Install

Just install through package control.

Alt + (↑ or ↓)

Numbers

Values

Flipping lower/upper cases per letter.

Cmd + Alt + (↑ or ↓)

Numbers

Increment | decrement by 10.

Values

Flipping lower/upper cases per word.

Cmd + Ctl + Alt + (↑ or ↓)

Numbers

Increment | decrement by 100.

Values

Switching values based on configuration in “inc_dec_value.sublime-settings”.