VS Code配置Emmet后Markdown无提示,需补充哪些设置?
Hey there! I’ve dealt with this exact frustration before—getting Emmet to play nice with Markdown in VS Code takes a couple extra tweaks beyond just the includeLanguages setting. Let’s get it sorted:
First, add these configurations to your user settings (File > Preferences > Settings, then open the JSON view):
1. Enable Quick Suggestions for Markdown
VS Code disables automatic suggestions in Markdown by default for some contexts. Add this to tell it to show Emmet hints:
"[markdown]": { "editor.quickSuggestions": { "other": true, "strings": true, "comments": false } }
2. Ensure Emmet’s Expansion Triggers Correctly
Double-check this setting (you might already have it, but confirm):
"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly"
Since you mapped markdown to html, this should include your Markdown files. If it still doesn’t work, try setting it to "always" temporarily to rule out context issues.
3. Enable Tab Completion
Make sure Tab triggers Emmet expansions without needing to manually invoke suggestions:
"editor.tabCompletion": "on"
Once you’ve added these, reload VS Code (press Cmd+Shift+P, search for "Reload Window").
Now test it out: open a Markdown file, type something like div>p{Hello World}, then hit Tab. It should expand to:
<div> <p>Hello World</p> </div>
A quick note: Emmet works best in Markdown when you’re writing HTML snippets (since that’s what it’s designed for). If you’re trying to use it in plain Markdown text (like headings or lists), it won’t trigger—stick to HTML contexts for Emmet magic.
内容的提问来源于stack exchange,提问作者ken

