Sublime Text 2 javascript docstring snippet
I found myself constantly writing documentation for javascript functions and making that a nice looking comment block always wasted my time. Save this snippet as a file ending with a .sublime-snippet extension and put it in /Users/borna/Library/Application Support/Sublime Text 2/Packages/JavaScript/ (cause it makes sense to put it there)
<snippet>
<content><![CDATA[
/**
* ${1}
*
* @method ${2}
* @param ${3}
* @return ${4}
*/
]]></content>
<tabTrigger>docstr</tabTrigger>
<scope>source.js</scope>
<description>Adds a docstring skeleton to a javascript function</description>
</snippet>
where * tabTrigger * is what you want to type before you press tab to expand the snippet. and scope.extention is the types of files (if not all files, when unspecified) you want this to be active on.
Written by Borna Almasi
Related protips
1 Response
Then you might like the DocBlockr Plugin for ST2 :-)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#