matt (support) wrote:...I'm not yet using snippets.
Well, in that case maybe I can get the ball rolling. This is my first attempt at a snippet. It enters a log statement
indigo.server.log(u'text: %s' % (var), type="plugin_name", isError=True)
at the insertion point. Tabbing across you can enter the text, var name, plugin name and then delete (press delete) or edit (TAB) the isError tag. The insertion point is left after the first %s.
Save this as ~/Library/Application Support/Sublime Text 2/Packages/Python/Indigo log debug.sublime-snippet
You can then call it by typing ild<TAB> in any Python code file.
- Code: Select all
<snippet>
<content><![CDATA[indigo.server.log(u'${1:text}: %s$0' % (${2:var}), type="${3:plugin_name}"${4:, isError=${5:True}})]]></content>
<tabTrigger>ild</tabTrigger>
<scope>source.python</scope>
<description>Indigo: logDebug</description>
</snippet>