Emmet: Emmet Editor Integration

Good news: you may already be using an editor that supports Emmet — VSCode, WebStorm, and Atom have it enabled by default, with zero configuration required.

1. What You'll Learn


2. A Front-End Developer's Real Story

(1) Pain Point: Relearning Emmet Every Time You Switch Editors

Bob is a front-end developer who recently started a new job. On his first day, the team gave him a computer with WebStorm pre-installed — not the VSCode he was used to. Bob opened WebStorm, typed div.box, pressed Tab... and nothing happened. He assumed WebStorm didn't support Emmet and went to ask his manager, who told him: "WebStorm has it enabled by default. Are you pressing the right key?" Bob was confused — turns out different editors have different Emmet trigger keys. VSCode uses Tab, WebStorm also uses Tab, but some older versions require Ctrl+Alt+Space. He then asked his colleague Alice what editor she used. Alice said Sublime Text, "but you need to install the Emmet plugin first and customize the keybinding — Tab won't work out of the box." Bob thought: if I switch editors, I have to reconfigure everything from scratch every time. That's a pretty high barrier.

(2) Emmet Editor Integration: The Solution

Emmet's answer: virtually all mainstream editors support Emmet natively or via plugins, but the trigger method, file type coverage, and configuration requirements vary. After completing this lesson, Bob made a cheat sheet and pinned it above his desk:

Editor Enabled by Default Plugin Needed Default Keybinding File Types
VSCode Yes No Tab .html .css .jsx .tsx .vue
WebStorm / IntelliJ Yes No Tab .html .css .jsx .tsx .vue
Sublime Text No Yes Ctrl+E (after plugin install) .html .css
Atom Yes No Tab .html .css
Vim / Neovim No Yes Custom .html .css
Brackets Yes No Ctrl+Alt+Space .html .css

With this cheat sheet, Bob can get Emmet running in any editor within 5 minutes.

(3) Benefits

Knowing your editor's support status brings two benefits: first, it saves configuration time — no more stumbling through setup every time you switch editors. Second, it avoids interference — you'll know which keys Emmet "owns," so you won't accidentally trigger expansion where you don't want it. After this lesson, you'll be able to get Emmet up and running in your editor of choice within 5 minutes.


3. Editor Support Overview

One of Emmet's design goals is editor agnosticism — the same abbreviation ul>li*3 expands identically in VSCode, WebStorm, and Sublime. The only differences lie in how it's integrated and how it's triggered.

Editor Enabled by Default Plugin Needed Default Keybinding HTML CSS JSX/TSX
VSCode Yes No Tab Yes Yes Yes (config required)
WebStorm / IntelliJ Yes No Tab Yes Yes Yes
Sublime Text No Yes (Emmet plugin) Ctrl+E (customizable) Yes Yes Manual enable needed
Atom Yes No Tab Yes Yes Manual enable needed
Vim / Neovim No Yes (emmet-vim) Custom (e.g., <C-y>,) Yes Yes Config required
Brackets Yes No Ctrl+Alt+Space Yes Yes No

Tip: JSX/TSX syntax differs slightly from standard HTML (class is written as className). Some editors need the "Emmet in JSX" option explicitly enabled for correct expansion.


Below we walk through Emmet setup for the three most commonly used editors: VSCode, WebStorm, and Sublime Text.

(1) VSCode: Works Out of the Box

VSCode has the most comprehensive Emmet support. Versions 1.0 and later have Emmet enabled by default — no plugins needed, just press Tab in HTML or CSS files to expand.

▶ Example: Verify Emmet in VSCode (Difficulty: ★)

Step 1: Create a new HTML file

BASH
# Press Ctrl+N in VSCode to create a new file
# Save it as test.html (VSCode auto-detects the language by extension)

Step 2: Type an Emmet abbreviation

HTML
div.container>h1{Hello Emmet}+p.lead{My first Emmet expansion in VSCode}

Step 3: Press Tab to trigger

HTML
<div class="container">
  <h1>Hello Emmet</h1>
  <p class="lead">My first Emmet expansion in VSCode</p>
</div>

Output:

TEXT 📖 Display only
One line of abbreviation instantly expands to 4 lines of HTML, with the cursor positioned inside the h1. VSCode's default Tab key works for Emmet expansion with zero configuration.

Enabling Emmet in JSX/TSX files (optional):

JSON
// Add to settings.json (Ctrl+Shift+P → "Preferences: Open User Settings (JSON)")
{
  "emmet.includeLanguages": {
    "javascript": "javascriptreact",
    "typescript": "typescriptreact"
  }
}

(2) WebStorm / IntelliJ: Tab Trigger by Default

All JetBrains IDEs (IntelliJ IDEA, PyCharm, PhpStorm, etc.) ship with Emmet integrated — no installation required. The trigger key is also Tab, but there's a nuance: WebStorm's Tab key may first attempt code completion; you may need to press Tab multiple times to trigger Emmet expansion.

▶ Example: Verify Emmet in WebStorm (Difficulty: ★)

Step 1: Create a new HTML file

BASH
# File → New → HTML File → name it test.html

Step 2: Type the abbreviation and press Tab

HTML
ul.nav>li*4>a[href="#"]{Menu $}

Step 3: Expansion result

HTML
<ul class="nav">
  <li><a href="#">Menu 1</a></li>
  <li><a href="#">Menu 2</a></li>
  <li><a href="#">Menu 3</a></li>
  <li><a href="#">Menu 4</a></li>
</ul>

Output:

TEXT 📖 Display only
A navigation menu with 4 list items generated instantly. If Tab doesn't respond, press `Ctrl+Alt+Space` to force Emmet expansion (WebStorm's fallback keybinding).

(3) Sublime Text: Plugin Required

Sublime Text does not include Emmet by default. You need to install the Emmet plugin via Package Control. After installation, the default keybinding is Ctrl+E (not Tab, since Tab is reserved for indentation in Sublime).

▶ Example: Install Emmet in Sublime Text (Difficulty: ★★)

Step 1: Install Package Control

BASH
# If Package Control is not yet installed:
# 1. Press Ctrl+` to open the console
# 2. Paste the Package Control install code (from https://packagecontrol.io/installation)
# 3. Restart Sublime Text

Step 2: Install the Emmet plugin

BASH
# 1. Press Ctrl+Shift+P to open the command palette
# 2. Type "Package Control: Install Package" and press Enter
# 3. Search for "Emmet" and press Enter to install
# 4. The plugin is enabled automatically after install

Step 3: Use Ctrl+E to trigger

HTML
<!-- Type the abbreviation -->
form>(input[type=email])+(input[type=password])+button{Login}
<!-- Press Ctrl+E (NOT Tab) -->

Expansion result:

HTML
<form>
  <input type="email">
  <input type="password">
  <button>Login</button>
</form>

Output:

TEXT 📖 Display only
Trigger with Ctrl+E to generate 3 form elements instantly. To switch to Tab as the trigger key, see the custom keybinding example below.

(4) Custom Keybindings: Tab vs. Ctrl+E

Many developers prefer pressing Tab to trigger Emmet, but editors like Sublime Text and Vim reserve Tab for other functions. This section shows how to extend VSCode's Tab trigger to JSX files — or switch to Ctrl+E.

▶ Example: Customize Emmet Configuration in VSCode (Difficulty: ★★)

Scenario A: Enable Tab trigger for JSX/TSX files

JSON
// settings.json
{
  "emmet.triggerExpansionOnTab": true,
  "emmet.includeLanguages": {
    "javascript": "javascriptreact",
    "typescript": "typescriptreact",
    "vue-html": "html",
    "razor": "html"
  }
}

Scenario B: Change Emmet trigger to Ctrl+E (matching Sublime)

JSON
// keybindings.json (Ctrl+Shift+P → "Preferences: Open Keyboard Shortcuts (JSON)")
[
  {
    "key": "ctrl+e",
    "command": "editor.action.emmet.action.expandAbbreviation",
    "when": "editorTextFocus && !editorReadonly"
  }
]

Scenario C: Disable Emmet in specific file types

JSON
// settings.json (to disable Emmet in markdown files)
{
  "emmet.excludeLanguages": ["markdown"]
}

Output:

TEXT 📖 Display only
With the above settings, you can remap the Emmet trigger key to any shortcut that fits your team's habits or personal preference, and precisely control which file types Emmet activates in.

5. File Type Auto-Enable Rules

Each editor supports a slightly different set of file types for Emmet. The general rule: HTML and CSS are fully enabled by default; JSX/TSX is on by default in VSCode/WebStorm but requires manual enable in Sublime; Vue, Svelte, and others need extra configuration.

File Type VSCode WebStorm Sublime Text Notes
.html .htm Yes Yes Yes Default support
.css Yes Yes Yes Default support
.js .jsx Yes (requires emmet.includeLanguages) Yes Manual enable needed JSX needs className mode
.ts .tsx Yes (requires config) Yes Manual enable needed Same as JSX
.vue Yes (requires config) Yes (with Vue plugin) Manual enable needed Vue SFC files
.svelte Yes (requires Svelte plugin) Plugin needed No Svelte templates
.md .markdown Optional Optional Optional Inline HTML in Markdown

Tip: If Emmet doesn't respond to Tab in a specific file type, first check your editor's file type association settings to confirm Emmet is enabled for that language.


❓ FAQ

Q Tab doesn't work in my VSCode. What did I misconfigure?
A First, make sure the file is saved with a .html or .css extension (VSCode won't treat extensionless files as HTML). Second, check if you have any plugins installed that intercept Tab (such as older versions of Vetur) — try disabling them temporarily. Finally, verify that emmet.triggerExpansionOnTab is set to true.
Q In WebStorm, Tab always triggers code completion first, and I have to press Tab multiple times. What can I do?
A This is by design in WebStorm — Tab prioritizes code completion. Two workarounds: 1) After typing the abbreviation, wait for the code completion popup to appear, press Esc to dismiss it, then press Tab to trigger Emmet. 2) Use Ctrl+Alt+Space to force Emmet expansion.
Q After installing the Emmet plugin in Sublime Text, Tab still doesn't work. What key should I use?
A Sublime Text's Emmet default trigger is Ctrl+E, not Tab (Tab is reserved for indentation in Sublime). To use Tab instead, customize the keybinding — see section 4(4) of this lesson.
Q In JSX files, Emmet expands class instead of className. How do I fix this?
A This is Emmet's standard behavior in JSX contexts. To expand as className, you can explicitly write className in your abbreviation (Emmet outputs it as-is), or enable the "JSX mode" auto-conversion in your editor (VSCode's emmet.syntaxProfiles setting).

📖 Summary


📝 Exercises

  1. Basic (Difficulty: ★): In your current editor, create a new .html file, type div.container>ul>li*3>a, press the default keybinding, record the expansion result, and take a screenshot.
  2. Intermediate (Difficulty: ★★): Open your editor's settings, find the Emmet-related configuration options, list 3 options you weren't aware of before (e.g., trigger key, included languages, excluded languages), and describe what each does.
  3. Challenge (Difficulty: ★★★): If you frequently use JSX/TSX or Vue files, configure your editor to enable Emmet in those file types. Then write a single Emmet abbreviation that expands to a complete JSX component (including props and event binding).
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏