Last active
December 21, 2015 01:19
-
-
Save cletusw/6226703 to your computer and use it in GitHub Desktop.
Here's a Sublime Text snippet for quickly creating polymer-elements. Just type "<polymer" and press TAB to generate the empty element, then tab through the different fields to add a name (which is automatically mirrored to the Polymer() call), attribute default values in the prototype (which are automatically mirrored to the "attributes" attribu…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
<link rel="import" href="../../bower_components/polymer/polymer.html"> | |
<polymer-element name="$1" attributes="${2/:[^\n$]*(\n[ \t]*|$)/ /g}"> | |
<template> | |
<style> | |
:host { | |
display: block; | |
} | |
</style>$3 | |
</template> | |
<script> | |
Polymer('$1', { | |
$2 | |
}); | |
</script> | |
</polymer-element> | |
]]></content> | |
<tabTrigger><polymer</tabTrigger> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had to turn off parenthesis/quotation mark/etc auto matching by adding "auto_match_enabled": false to my settings, otherwise Sublime would stop mirroring to the "attributes" attribute the minute I typed an opening parenthesis/quotation mark/etc. Does anyone know how to allow auto-matching and still stay in the cool Snippets mirroring mode?