To achieve this easily:
start: function() {
...
}
You just need to write the name of the method start
and then press command + shift + enter
.
Create a new file and name it object-method-command.sublime-snippet
and add it to ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/JavaScript/
<snippet>
<content>
<![CDATA[: function() {
${1:...}
},]]>
</content>
<tabTrigger>object-method</tabTrigger>
<scope>source.js</scope>
<!-- Optional: Description to show in the menu -->
<description>Object method / instance function</description>
</snippet>
Go to Preferences > Key Bindings - Default
and then add this object at the end of the array:
{ "keys": ["option+shift+enter"], "command": "insert_snippet", "args": { "name": "Packages/JavaScript/object-method-command.sublime-snippet" } }