Force Emmet (VS Code) to wrap all abbreviations inline

让人想犯罪 __ 提交于 2019-12-02 01:35:12

问题


I often wrap parts of my HTML text inside tags using Emmet in VS Code.

The command is "Emmet: Wrap with Abbreviation" (Alt+Shift+W on Windows).

It it possible to force Emmet to wrap all my selection inline, i.e. on the same line?

See example below, where a <p> tag automatically puts my selection on a new line, and a <span> tag just wraps my selection in the same line.

I would like all wrap-with-abbreviations to behave like the <span example.


回答1:


Try this in your settings:

"emmet.syntaxProfiles": {
  "html": {
     "tag_nl": false
  }
}

tag_nl:

output each tag on new line with indentation, boolean. Values are true (each tag on new line), false (no formatting) and 'decide' (string; only block-level elements on new lines).

See emmet doc on syntax profiles and vscode emmet config

This will do what you want but it appears to apply to all emmet expansions, not just wraps.



来源:https://stackoverflow.com/questions/53390142/force-emmet-vs-code-to-wrap-all-abbreviations-inline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!