Choan's TextMate Snippets
Building and sharing my own collection of not-belonging-to-other-bundles commands and snippets.
Tab completions for HTML
-
=<tab>
writesname="value"
pair when inside a tag. -
#<tab>
creates anid
attribute when inside a tag; adiv
–or any other element–with anid
attribute otherwise. -
.<tab>
creates aclass
attribute when inside a tag; adiv
–or any other element–with aclass
attribute otherwise. -
lang<tab>
creates bothlang
andxml:lang
attributes -
hlang<tab>
creates ahreflang
attributes -
ns<tab>
inserts the HTML namespace
Tab completions for CSS
-
zero<tab>
writesmargin: 0; padding: 0;
-
cl<tab>
writes aclear: something
rule. Type l/r/b for left/right/both -
fl<tab>
writes afloat: something
rule. Type l/r/n for left/right/none -
mauto<tab>
writesmargin: 0 auto;
Shortcuts for CSS
- When in a property value,
<ESC>
switches units between em/px/%
Tab completions for JS
-
t<tab>
writesthis.
-
f<tab>
andfun
to write anonymous functions (same shortcuts as the JavaScript bundle, slightly different output) -
doc<tab>
writesdocument
-
$<tab>
writes$()
-
fo<tab>
writes a for loop.
Shortcuts for JS
-
⌥:
creates akey: 'value'
pair