You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在VSCode中禁用Emmet缩写编辑器首行功能,并将Emmet缩写从代码建议首位移除或移至列表末尾?

Hey there, let's get those two VSCode Emmet annoyances sorted for you—both are manageable with a few quick settings tweaks or workarounds:

1. Disable Emmet Abbreviation Functionality on the Editor's First Line

Unfortunately, VSCode doesn’t have a built-in setting to specifically disable Emmet only when your cursor is on the first line of a file. But you’ve got two solid options:

Option 1: Disable Emmet's abbreviation suggestions entirely

If you don’t need Emmet’s abbreviation expansions anywhere in your files, add this to your settings.json:

"emmet.showExpandedAbbreviation": "never"

To open settings.json: Press Ctrl+, (Windows/Linux) or Cmd+, (Mac) to open settings, then click the curly bracket icon in the top-right corner.

Option 2: Toggle Emmet on/off for the first line with a keybinding

If you still want Emmet working elsewhere but not on the first line, set up a custom keybinding to toggle it when your cursor is on line 1:

  1. Open keybindings.json by pressing Ctrl+K Ctrl+S (Windows/Linux) or Cmd+K Cmd+S (Mac), then click the "Open Keyboard Shortcuts (JSON)" icon.
  2. Add this entry (you can change the key combination to whatever you prefer):
{
  "key": "ctrl+shift+e",
  "command": "emmet.toggleExpandedAbbreviation",
  "when": "editorTextFocus && lineNumber == 1"
}

2. Move Emmet Abbreviations to the End of Code Suggestions (or Disable Them)

This one’s straightforward—you can either push Emmet’s suggestions to the bottom of the completion list or turn them off entirely:

Option 1: Move Emmet suggestions to the end

Add these lines to your settings.json to make Emmet’s suggestions behave like regular snippets and get sorted to the bottom:

"emmet.showSuggestionsAsSnippets": true,
"editor.snippetSuggestions": "bottom"

Option 2: Disable Emmet suggestions completely

If you don’t want Emmet showing up in the code completion list at all, use these settings:

"emmet.showSuggestionsAsSnippets": false,
"emmet.showExpandedAbbreviation": "never"

内容的提问来源于stack exchange,提问作者ZiiMakc

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 11:17:43