choan.tmbundle

Created: 2008-11-08 01:25
Updated: 2016-05-08 16:27

README.mdown

Choan's TextMate Snippets

Building and sharing my own collection of not-belonging-to-other-bundles commands and snippets.

Tab completions for HTML

  • =<tab> writes name="value" pair when inside a tag.
  • #<tab> creates an id attribute when inside a tag; a div–or any other element–with an id attribute otherwise.
  • .<tab> creates a class attribute when inside a tag; a div–or any other element–with a class attribute otherwise.
  • lang<tab> creates both lang and xml:lang attributes
  • hlang<tab> creates a hreflang attributes
  • ns<tab> inserts the HTML namespace

Tab completions for CSS

  • zero<tab> writes

      margin: 0;
      padding: 0;
    
  • cl<tab> writes a clear: something rule. Type l/r/b for left/right/both

  • fl<tab> writes a float: something rule. Type l/r/n for left/right/none

  • mauto<tab> writes margin: 0 auto;

Shortcuts for CSS

  • When in a property value, <ESC> switches units between em/px/%

Tab completions for JS

  • t<tab> writes this.
  • f<tab> and fun to write anonymous functions (same shortcuts as the JavaScript bundle, slightly different output)
  • doc<tab> writes document
  • $<tab> writes $()
  • fo<tab> writes a for loop.

Shortcuts for JS

  • ⌥: creates a key: 'value' pair
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more