Skip to content

Instantly share code, notes, and snippets.

@clamstew
Created October 6, 2015 18:30
Show Gist options
  • Save clamstew/bdc872dbe575beda45bf to your computer and use it in GitHub Desktop.
Save clamstew/bdc872dbe575beda45bf to your computer and use it in GitHub Desktop.
<snippet>
<content><![CDATA[
console.${1:log}('${2:message}', ${3:code});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cl</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
@clamstew
Copy link
Author

clamstew commented Oct 6, 2015

To install

  1. In Sublime Text, go to Tools > New Snippet....
  2. copy and paste in the above snippet
  3. save file as console_message.sublime-snippet, in the default place that Sublime wants you to save it (~/Library/Application Support/Sublime Text 3/Package/User/console_message.sublime-snippet)

To use

Type cl and press tab, and it will auto-complete.
First tab, user lands on log, which can switch to warn, info, etc.
Second tab, user lands on the message - declare what you are logging.
Third tab, user lands on the code, which allows you to pass in a js variable to log.

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