I can't get <a></a> tags in new lines when using emmet in VS code [duplicate]
Asked Answered
K

3

8

enter image description here

When I enter a*5, I expected to get five tags in new lines. However, the five tags I got were in the same line like this.

enter image description here

How should I change my settings in VScode in order to have five tags in new lines?

enter image description here

Kidding answered 20/2, 2021 at 15:16 Comment(1)
For your reference, I created a new issue on VS Code's repo about inline tags not starting at new lines and they responded that it is designed that way. I remember inline tags used to always start at new lines so maybe they changed somethingDube
U
14

It look like you need this in your settings:

"emmet.syntaxProfiles": {

  "html": {
    "inline_break": 1
  },
},

That will put all tags, including span and other typically inline tags, on their own line. There is no way to restrict it to a tags.

I thought "tag_nl" : true would work but it didn't.

See emmet syntaxProfiles.

Underbred answered 20/2, 2021 at 21:51 Comment(1)
Thanks buddy, I can get inline tags in new lines using emmet.Kidding
K
2

The accepted solution here didn't work for me, but I could solve with the solution posted here by Addem. It basically says, in the settings.json file (Ctrl + , > Extensions > Emmet > Preferences > Edit in "settings.json"), add this line:

    "emmet.preferences": {
    "output.inlineBreak": 1,
},
Kippie answered 6/10, 2022 at 14:6 Comment(0)
T
0

Go to File> Preferences > Settings or you can use shortcut (Ctrl +,) You'll see Extensions> Emmet > scroll down and you'll find Preferences. Click Edit in settings.json Use the code from below:

"emmet.syntaxProfiles": {

  "html": {
    "inline_break": 1
  },
}
Toothpick answered 8/7, 2022 at 6:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.