Shortcuts

  • Ctrl + Shift + I to open developer tools.
  • Ctrl + Shift + P to open command panel.
  • Ctrl + Shift + F5 to reload Atom.

snippets.cson

'.source.js':
  'Console log':
    'prefix': 'log'
    'body': 'console.log($1);'
  'WebComponents V0':
    'prefix': 'webcom0'
    'body': """
      var proto = Object.create(HTMLElement.prototype)

      proto.createdCallback  = function() {
        $2
      }

      proto.attachedCallback = function() {
        $3
      }

      document.registerElement("$1", {
        prototype: proto
      });
    """

  "WebComponents V1":
    'prefix': 'webcom1'
    'body': """
      class ${1:HelloWorld} extends HTMLElement {
        constructor() {
          super();

          $3
        }
      }

      customElements.define('${2:hello-world}', ${1:HelloWorld});
    """

  'close':
    'prefix': 'fc'
    'body': """
      !(function() {
        $1
      })();
    """

  'if, else if, else':
    'prefix': 'ieie'
    'body': """
      if (${1:true}) {
        $2
      } else if (${3:false}) {
        $4
      } else {
        $5
      }
    """

ESlint for Atom