Getting Emmet to expand for more syntaxes in Atom

Written by Michael Lee on February 5, 2018

Emmet is a nice plugin that lets you write HTML and CSS using abbreviations that expands out to it’s full code equivalent.

For example:


After typing the above and hitting the expansion trigger in your preferred editor will produce this:

<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">

This allows you as a developer to not sweat about remembering the structure of certain markup and also saves you time.

By default the Emmet plugin for the Atom editor will expand abbreviations using the tab key for HTML, CSS, Sass/CSS and LESS syntaxes. But what if you’re a front-end developer using Emmet with JSX for React or Handlebars for Ember.js? Or working in a Markdown file for Jekyll? Typing your Emmet abbreviations and hitting the tab key doesn’t trigger the magic that you’re used to from Emmet.

You can add additional support for syntaxes like JSX or Liquid to Emmet in Atom by going to Atom > Keymap… then in the keymap.cson file that opens up, copy and paste this:

  'tab': 'emmet:expand-abbreviation-with-tab'

Then restart Atom and when you’re back in Atom, you should now be able to tab expand Emmet abbreviations in syntaxes like JSX or Markdown.

Thanks for taking the time to read this article. I'd love to stay in touch and share more tips on programming and design, side projects and working remotely. Sign up and I'll send you my articles straight to your email.

:wave: Hey hey, I'm Michael Lee! I really appreciate you taking the time to read this article.

Be sure to check out my other articles.