Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Emmet (VS Code) to wrap all abbreviations inline

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.

Animated example of questioned behaviour in VSCode

like image 878
Cody MacPixelface Avatar asked Dec 21 '25 22:12

Cody MacPixelface


1 Answers

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.

like image 169
Mark Avatar answered Dec 24 '25 12:12

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!