How can I enable Emmet in Sublime Text 3 for Markdown?

Viewed 227

Recently, Emmets tab-expansion in Sublime Text 3 stopped working for me. I can still Ctr+Shift+P and enter: "Emmet: Expand abbreviation". But when I press just TAB it stopped working.

How can I trigger the abbreviation expansion with tab, being in a markdown file?

What I tried

I added this to my keybindings, but it didn't have any effect:

{"keys": ["tab"], "args": {"action": "expand_abbreviation"}, "command": "run_emmet_action", "context": [{"key": "emmet_action_enabled.expand_abbreviation"}]}
1 Answers

You need to manually add markdown scope to Emmet settings.

  1. Open Preferences -> Package Settings -> Emmet -> Settings.
  2. Copy the abbreviation_scopes section from the left side to the right and add this line to it:

"text.html.markdown",

My user settings now look like this:

{
    "abbreviation_scopes": [
        "text.html.markdown",
        "(text.html | text.xml) - source - meta - comment",
        "source.sass - meta.property-value - meta.property-name - string - punctuation - comment",
        "(source.css | source.scss | source.less | source.postcss | source.stylus) & meta.property-list",
        "(source.css | source.scss | source.less | source.postcss | source.stylus) - meta.property-value - meta.property-name - string - comment",
        "(source.tsx | source.js | source.jsx) - comment",
        "text.html.cfml - meta.tag",
        // Inline CSS
        "text.html meta.attribute-with-value.style (string.quoted | source.css)"
    ],
}

Tab expansions will now work in Markdown.

Related