#Snippet Instructions...
##Create a new Snippet
-
Tools > New Snippet...
-
Put your code in here (don't delete the cdata tags)...
-
Uncomment the tabTrigger tags and input the text shortcut you want to use for this tab e.g. switch
-
Uncomment the scope tags if you want to restrict this code to only operate on certain file extensions i.e. if you want a ruby 'if' snippet and a javascript 'if' snippet For Ruby use... source.rb For Javascript use... source.rb
-
Save your file This will automatically default to the correct folder Make sure the file extension ".sublime-snippet"
##Using your Snippet type your tabTrigger keyword and press TAB
##If you want to override a default snippet...
-
First you need to remove the default snippet Navigate to "/Users/USERNAME/Library/Application Support/Sublime Text 2/Packages/LanguageName"
-
Open the relevant folder /JavaScript OR /Ruby
-
Find the relevant snippet and rename it (I don't recommend deleting it!) I just put .UNUSED on the end so it was no longer picked up
##Issues
If you find your snippet deletes itself when you press TAB it is possible you need to escape a character in your section. If you have a "$" sign, try change this to "$"