Skip to content

Instantly share code, notes, and snippets.

@mainerror
Created March 28, 2012 16:12
Show Gist options
  • Save mainerror/2227870 to your computer and use it in GitHub Desktop.
Save mainerror/2227870 to your computer and use it in GitHub Desktop.
Sublime Text 2 JavaScript self-executing function expression snippet
<snippet>
<content><![CDATA[(function() {
${0:$TM_SELECTED_TEXT}
})();]]></content>
<tabTrigger>funcx</tabTrigger>
<scope>source.js</scope>
<description>Self-executing function expression</description>
</snippet>
@mainerror
Copy link
Author

All you have to do is to download that file and save it in ~/.config/sublime-text-2/Packages/User/JavaScript

Next time you type funx and hit Tab it will result in a function expression optionally wrapping previously selected text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment